Struct gapi_grpc::google::bytestream::byte_stream_client::ByteStreamClient[][src]

pub struct ByteStreamClient<T> { /* fields omitted */ }

Introduction

The Byte Stream API enables a client to read and write a stream of bytes to and from a resource. Resources have names, and these names are supplied in the API calls below to identify the resource that is being read from or written to.

All implementations of the Byte Stream API export the interface defined here:

Service parameters and metadata

The ByteStream API provides no direct way to access/modify any metadata associated with the resource.

Errors

The errors returned by the service are in the Google canonical error space.

Implementations

impl ByteStreamClient<Channel>[src]

pub async fn connect<D>(dst: D) -> Result<Self, Error> where
    D: TryInto<Endpoint>,
    D::Error: Into<StdError>, 
[src]

Attempt to create a new client by connecting to a given endpoint.

impl<T> ByteStreamClient<T> where
    T: GrpcService<BoxBody>,
    T::ResponseBody: Body + HttpBody + Send + 'static,
    T::Error: Into<StdError>,
    <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send
[src]

pub fn new(inner: T) -> Self[src]

pub fn with_interceptor(inner: T, interceptor: impl Into<Interceptor>) -> Self[src]

pub async fn read(
    &mut self,
    request: impl IntoRequest<ReadRequest>
) -> Result<Response<Streaming<ReadResponse>>, Status>
[src]

Read() is used to retrieve the contents of a resource as a sequence of bytes. The bytes are returned in a sequence of responses, and the responses are delivered as the results of a server-side streaming RPC.

pub async fn write(
    &mut self,
    request: impl IntoStreamingRequest<Message = WriteRequest>
) -> Result<Response<WriteResponse>, Status>
[src]

Write() is used to send the contents of a resource as a sequence of bytes. The bytes are sent in a sequence of request protos of a client-side streaming RPC.

A Write() action is resumable. If there is an error or the connection is broken during the Write(), the client should check the status of the Write() by calling QueryWriteStatus() and continue writing from the returned committed_size. This may be less than the amount of data the client previously sent.

Calling Write() on a resource name that was previously written and finalized could cause an error, depending on whether the underlying service allows over-writing of previously written resources.

When the client closes the request channel, the service will respond with a WriteResponse. The service will not view the resource as complete until the client has sent a WriteRequest with finish_write set to true. Sending any requests on a stream after sending a request with finish_write set to true will cause an error. The client should check the WriteResponse it receives to determine how much data the service was able to commit and whether the service views the resource as complete or not.

pub async fn query_write_status(
    &mut self,
    request: impl IntoRequest<QueryWriteStatusRequest>
) -> Result<Response<QueryWriteStatusResponse>, Status>
[src]

QueryWriteStatus() is used to find the committed_size for a resource that is being written, which can then be used as the write_offset for the next Write() call.

If the resource does not exist (i.e., the resource has been deleted, or the first Write() has not yet reached the service), this method returns the error NOT_FOUND.

The client may call QueryWriteStatus() at any time to determine how much data has been processed for this resource. This is useful if the client is buffering data and needs to know which data can be safely evicted. For any sequence of QueryWriteStatus() calls for a given resource name, the sequence of returned committed_size values will be non-decreasing.

Trait Implementations

impl<T: Clone> Clone for ByteStreamClient<T>[src]

impl<T> Debug for ByteStreamClient<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for ByteStreamClient<T>

impl<T> Send for ByteStreamClient<T> where
    T: Send

impl<T> Sync for ByteStreamClient<T> where
    T: Sync

impl<T> Unpin for ByteStreamClient<T> where
    T: Unpin

impl<T> !UnwindSafe for ByteStreamClient<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]