pub struct ResultStoreUploadClient<T> { /* private fields */ }
Expand description

This is the interface used to upload information to the ResultStore database, to update that information as necessary, and to make it immutable at the end.

This interface intentionally does not support user read-modify-write operations. They may corrupt data, and are too expensive. For the same reason, all upload RPCs will return no resource fields except name and ID. An uploader should hold as little state as possible in memory to avoid running out of memory.

Implementations§

source§

impl<T> ResultStoreUploadClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

pub fn with_interceptor<F>( inner: T, interceptor: F ) -> ResultStoreUploadClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

pub async fn create_invocation( &mut self, request: impl IntoRequest<CreateInvocationRequest> ) -> Result<Response<Invocation>, Status>

Creates the given invocation.

This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Invocation proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If an invocation with the same ID already exists.
source

pub async fn update_invocation( &mut self, request: impl IntoRequest<UpdateInvocationRequest> ) -> Result<Response<Invocation>, Status>

Applies a standard update to the invocation identified by the given proto’s name. For all types of fields (primitive, message, or repeated), replaces them with the given proto fields if they are under the given field mask paths. Fields that match the mask but aren’t populated in the given invocation are cleared. This is an implicitly idempotent API.

Returns an empty Invocation proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the invocation does not exist.
  • If the invocation is finalized.
  • If no field mask was given.
source

pub async fn merge_invocation( &mut self, request: impl IntoRequest<MergeInvocationRequest> ) -> Result<Response<Invocation>, Status>

Applies a merge update to the invocation identified by the given proto’s name. For primitive and message fields, replaces them with the ones in the given proto if they are covered under the field mask paths. For repeated fields, merges to them with the given ones if they are covered under the field mask paths. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Invocation proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the invocation does not exist.
  • If the invocation is finalized.
  • If no field mask was given.
source

pub async fn touch_invocation( &mut self, request: impl IntoRequest<TouchInvocationRequest> ) -> Result<Response<TouchInvocationResponse>, Status>

Touches the invocation identified by the given proto’s name.

This is useful when you need to notify ResultStore that you haven’t abandoned the upload, since abandoned uploads will be automatically finalized after a set period.

An error will be reported in the following cases:

  • If the invocation does not exist.
  • If the invocation is finalized.
source

pub async fn finalize_invocation( &mut self, request: impl IntoRequest<FinalizeInvocationRequest> ) -> Result<Response<FinalizeInvocationResponse>, Status>

Declares the invocation with the given name as finalized and immutable by the user. It may still be mutated by post-processing. This is an implicitly idempotent API.

If an Invocation is not updated for 24 hours, some time after that this will be called automatically.

An error will be reported in the following cases:

  • If the invocation does not exist.
source

pub async fn delete_invocation( &mut self, request: impl IntoRequest<DeleteInvocationRequest> ) -> Result<Response<()>, Status>

Deletes an immutable invocation (permanently) Note: this does not delete indirect data, e.g. files stored in other services.

An error will be reported in the following cases:

  • If the invocation does not exist.
  • If the invocation is not finalized. This can be retried until it is.
source

pub async fn create_target( &mut self, request: impl IntoRequest<CreateTargetRequest> ) -> Result<Response<Target>, Status>

Creates the given target under the given parent invocation. The given target ID is URL encoded, converted to the full resource name, and assigned to the target’s name field. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Target proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If no target ID is provided.
  • If the parent invocation does not exist.
  • If the parent invocation is finalized.
  • If a target with the same name already exists.
source

pub async fn update_target( &mut self, request: impl IntoRequest<UpdateTargetRequest> ) -> Result<Response<Target>, Status>

Applies a standard update to the target identified by the given proto’s name. For all types of fields (primitive, message, or repeated), replaces them with the given proto fields if they are under the given field mask paths. Fields that match the mask but aren’t populated in the given target are cleared. This is an implicitly idempotent API.

Returns an empty Target proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the target does not exist.
  • If the target or parent invocation is finalized.
  • If no field mask was given.
source

pub async fn merge_target( &mut self, request: impl IntoRequest<MergeTargetRequest> ) -> Result<Response<Target>, Status>

Applies a merge update to the target identified by the given proto’s name. For primitive and message fields, replaces them with the ones in the given proto if they are covered under the field mask paths. For repeated fields, merges to them with the given ones if they are covered under the field mask paths. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Target proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the target does not exist.
  • If the target or parent invocation is finalized.
  • If no field mask was given.
source

pub async fn finalize_target( &mut self, request: impl IntoRequest<FinalizeTargetRequest> ) -> Result<Response<FinalizeTargetResponse>, Status>

Declares the target with the given name as finalized and immutable by the user. It may still be mutated by post-processing. This is an implicitly idempotent API.

An error will be reported in the following cases:

  • If the target does not exist.
source

pub async fn create_configured_target( &mut self, request: impl IntoRequest<CreateConfiguredTargetRequest> ) -> Result<Response<ConfiguredTarget>, Status>

Creates the given configured target under the given parent target. The given configured target ID is URL encoded, converted to the full resource name, and assigned to the configured target’s name field. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty ConfiguredTarget proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If no config ID is provided.
  • If a configured target with the same ID already exists.
  • If the parent target does not exist.
  • If the parent target or invocation is finalized.
source

pub async fn update_configured_target( &mut self, request: impl IntoRequest<UpdateConfiguredTargetRequest> ) -> Result<Response<ConfiguredTarget>, Status>

Applies a standard update to the configured target identified by the given proto’s name. For all types of fields (primitive, message, or repeated), replaces them with the given proto fields if they are under the given field mask paths. Fields that match the mask but aren’t populated in the given configured target are cleared. This is an implicitly idempotent API.

Returns an empty ConfiguredTarget proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the configured target does not exist.
  • If the parent target or invocation is finalized.
  • If no field mask was given.
source

pub async fn merge_configured_target( &mut self, request: impl IntoRequest<MergeConfiguredTargetRequest> ) -> Result<Response<ConfiguredTarget>, Status>

Applies a merge update to the configured target identified by the given proto’s name. For primitive and message fields, replaces them with the ones in the given proto if they are covered under the field mask paths. For repeated fields, merges to them with the given ones if they are covered under the field mask paths. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty ConfiguredTarget proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the configured target does not exist.
  • If the parent target or invocation is finalized.
  • If no field mask was given.
source

pub async fn finalize_configured_target( &mut self, request: impl IntoRequest<FinalizeConfiguredTargetRequest> ) -> Result<Response<FinalizeConfiguredTargetResponse>, Status>

Declares the configured target with the given name as finalized and immutable by the user. It may still be mutated by post-processing. This is an implicitly idempotent API.

An error will be reported in the following cases:

  • If the configured target does not exist.
source

pub async fn create_action( &mut self, request: impl IntoRequest<CreateActionRequest> ) -> Result<Response<Action>, Status>

Creates the given action under the given configured target. The given action ID is URL encoded, converted to the full resource name, and assigned to the action’s name field. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Action proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If no action ID provided.
  • If the parent configured target does not exist.
  • If the parent target or invocation is finalized.
  • If an action with the same name already exists.
source

pub async fn update_action( &mut self, request: impl IntoRequest<UpdateActionRequest> ) -> Result<Response<Action>, Status>

Applies a standard update to the action identified by the given proto’s name. For all types of fields (primitive, message, or repeated), replaces them with the given proto fields if they are under the given field mask paths. Fields that match the mask but aren’t populated in the given action are cleared. This is an implicitly idempotent API.

Returns an empty Action proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the action does not exist.
  • If the parent target or invocation is finalized.
  • If no field mask was given.
source

pub async fn merge_action( &mut self, request: impl IntoRequest<MergeActionRequest> ) -> Result<Response<Action>, Status>

Applies a merge update to the action identified by the given proto’s name. For primitive and message fields, replaces them with the ones in the given proto if they are covered under the field mask paths. For repeated fields, merges to them with the given ones if they are covered under the field mask paths. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Action proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the action does not exist.
  • If the parent target or invocation is finalized.
  • If no field mask was given.
source

pub async fn create_configuration( &mut self, request: impl IntoRequest<CreateConfigurationRequest> ) -> Result<Response<Configuration>, Status>

Creates the given configuration under the given parent invocation. The given configuration ID is URL encoded, converted to the full resource name, and assigned to the configuration’s name field. The configuration ID of “default” should be preferred for the default configuration in a single-config invocation. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty Configuration proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If no configuration ID is provided.
  • If the parent invocation does not exist.
  • If the parent invocation is finalized.
  • If a configuration with the same name already exists.
source

pub async fn update_configuration( &mut self, request: impl IntoRequest<UpdateConfigurationRequest> ) -> Result<Response<Configuration>, Status>

Applies a standard update to the configuration identified by the given proto’s name. For all types of fields (primitive, message, or repeated), replaces them with the given proto fields if they are under the given field mask paths. Fields that match the mask but aren’t populated in the given configuration are cleared. This is an implicitly idempotent API.

Returns an empty Configuration proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the configuration does not exist.
  • If the parent invocation is finalized.
  • If no field mask was given.
  • If a given field mask path is not valid.
source

pub async fn create_file_set( &mut self, request: impl IntoRequest<CreateFileSetRequest> ) -> Result<Response<FileSet>, Status>

Creates the given file set under the given parent invocation. The given file set ID is URL encoded, converted to the full resource name, and assigned to the file set’s name field. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty FileSet proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If no file set ID is provided.
  • If a file set with the same name already exists.
  • If the parent invocation does not exist.
  • If the parent invocation is finalized.
source

pub async fn update_file_set( &mut self, request: impl IntoRequest<UpdateFileSetRequest> ) -> Result<Response<FileSet>, Status>

Applies a standard update to the file set identified by the given proto’s name. For all types of fields (primitive, message, or repeated), replaces them with the given proto fields if they are under the given field mask paths. Fields that match the mask but aren’t populated in the given configuration are cleared. This is an implicitly idempotent API.

Returns an empty FileSet proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the file set does not exist.
  • If the parent invocation is finalized.
  • If no field mask was given.
  • If a given field mask path is not valid.
source

pub async fn merge_file_set( &mut self, request: impl IntoRequest<MergeFileSetRequest> ) -> Result<Response<FileSet>, Status>

Applies a merge update to the file set identified by the given proto’s name. For primitive and message fields, updates them with the ones in the given proto if they are covered under the field mask paths. For repeated fields, merges to them with the given ones if they are covered under the field mask paths. This is not an implicitly idempotent API, so a request id is required to make it idempotent.

Returns an empty FileSet proto with only the name and ID fields populated.

An error will be reported in the following cases:

  • If the file set does not exist.
  • If the parent invocation is finalized.
  • If a given field mask path is not valid.
  • If no field mask was given.
source

pub async fn upload_batch( &mut self, request: impl IntoRequest<UploadBatchRequest> ) -> Result<Response<UploadBatchResponse>, Status>

This is the RPC used for batch upload. It supports uploading multiple resources for an invocation in a transaction safe manner.

To use this RPC, the CreateInvocationRequest must have been provided a resume_token.

Combining batch upload with normal upload on a single Invocation is not supported. If an Invocation is created with a resume_token, all further calls must be through UploadBatch. If an Invocation is created without resume_token normal upload, all further upload calls must be through normal upload RPCs.

The recommend total size of UploadBatchRequest is 10 MiB. If it is too large, it may be rejected.

source

pub async fn get_invocation_upload_metadata( &mut self, request: impl IntoRequest<GetInvocationUploadMetadataRequest> ) -> Result<Response<UploadMetadata>, Status>

Provides a way to read the metadata for an invocation. The UploadMetadata could still be retrieved by this RPC even the Invocation has been finalized. This API requires setting a response FieldMask via ‘fields’ URL query parameter or X-Goog-FieldMask HTTP/gRPC header.

An error will be reported in the following case:

  • If the invocation does not exist.
  • If no field mask was given.

Trait Implementations§

source§

impl<T: Clone> Clone for ResultStoreUploadClient<T>

source§

fn clone(&self) -> ResultStoreUploadClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for ResultStoreUploadClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more