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

A sink for server streaming call.

To close the sink properly, you should call close or fail before dropping.

Implementations

By default it always sends messages with their configured buffer hint. But when the enhance_batch is enabled, messages will be batched together as many as possible. The rules are listed as below:

  • All messages except the last one will be sent with buffer_hint set to true.
  • The last message will also be sent with buffer_hint set to true unless any message is offered with buffer hint set to false.

No matter enhance_batch is true or false, it’s recommended to follow the contract of Sink and call poll_flush to ensure messages are handled by gRPC C Core.

Trait Implementations

The corresponding RPC will be canceled if the sink did not call close or fail before dropping.

The type of value produced by the sink when an error occurs.

Attempts to prepare the Sink to receive a value. Read more

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more

Flush any remaining output from this sink. Read more

Flush any remaining output and close this sink, if necessary. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Composes a function in front of the sink. Read more

Composes a function in front of the sink. Read more

Transforms the error returned by the sink.

Map this sink’s error to a different error type using the Into trait. Read more

Adds a fixed-size buffer to the current sink. Read more

Close the sink.

Fanout items to multiple sinks. Read more

Flush the sink, processing all pending items. Read more

A future that completes after the given item has been fully processed into the sink, including flushing. Read more

A future that completes after the given item has been received by the sink. Read more

A future that completes after the given stream has been fully processed into the sink, including flushing. Read more

Wrap this sink in an Either sink, making it the left-hand variant of that Either. Read more

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more

A convenience method for calling [Sink::poll_ready] on Unpin sink types. Read more

A convenience method for calling [Sink::start_send] on Unpin sink types. Read more

A convenience method for calling [Sink::poll_flush] on Unpin sink types. Read more

A convenience method for calling [Sink::poll_close] on Unpin sink types. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.