pub struct EncodeBody<T, U> { /* private fields */ }Expand description
A specialized implementation of Body for encoding Result<Bytes, Status>.
Implementations§
Source§impl<T, U> EncodeBody<T, U>
impl<T, U> EncodeBody<T, U>
Sourcepub fn new_client(
encoder: T,
source: U,
compression_encoding: Option<CompressionEncoding>,
max_message_size: Option<usize>,
) -> EncodeBody<T, U>
pub fn new_client( encoder: T, source: U, compression_encoding: Option<CompressionEncoding>, max_message_size: Option<usize>, ) -> EncodeBody<T, U>
Turns a stream of grpc messages into EncodeBody which is used by grpc clients for turning the messages into http frames for sending over the network.
Sourcepub fn new_server(
encoder: T,
source: U,
compression_encoding: Option<CompressionEncoding>,
compression_override: SingleMessageCompressionOverride,
max_message_size: Option<usize>,
) -> EncodeBody<T, U>
pub fn new_server( encoder: T, source: U, compression_encoding: Option<CompressionEncoding>, compression_override: SingleMessageCompressionOverride, max_message_size: Option<usize>, ) -> EncodeBody<T, U>
Turns a stream of grpc results (message or error status) into EncodeBody which is used by grpc servers for turning the messages into http frames for sending over the network.
Trait Implementations§
Source§impl<T, U> Body for EncodeBody<T, U>
impl<T, U> Body for EncodeBody<T, U>
Source§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns
true when the end of stream has been reached. Read moreSource§fn poll_frame(
self: Pin<&mut EncodeBody<T, U>>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<<EncodeBody<T, U> as Body>::Data>, <EncodeBody<T, U> as Body>::Error>>>
fn poll_frame( self: Pin<&mut EncodeBody<T, U>>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<<EncodeBody<T, U> as Body>::Data>, <EncodeBody<T, U> as Body>::Error>>>
Attempt to pull out the next data buffer of this stream.
Source§impl<T, U> Debug for EncodeBody<T, U>
impl<T, U> Debug for EncodeBody<T, U>
impl<'pin, T, U> Unpin for EncodeBody<T, U>where
<PinnedFieldsOfHelperStruct<__EncodeBody<'pin, T, U>> as PinnedFieldsOfHelperTrait>::Actual: Unpin,
Auto Trait Implementations§
impl<T, U> !RefUnwindSafe for EncodeBody<T, U>
impl<T, U> !UnwindSafe for EncodeBody<T, U>
impl<T, U> Freeze for EncodeBody<T, U>where
EncodedBytes<T, U>: Freeze,
impl<T, U> Send for EncodeBody<T, U>where
EncodedBytes<T, U>: Send,
impl<T, U> Sync for EncodeBody<T, U>where
EncodedBytes<T, U>: Sync,
impl<T, U> UnsafeUnpin for EncodeBody<T, U>where
EncodedBytes<T, U>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BodyExt for T
impl<T> BodyExt for T
Source§fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
Returns a future that resolves to the next
Frame, if any.Source§fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
Maps this body’s frame to a different kind.
Source§fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
Maps this body’s error value to a different value.
Source§fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
Turn this body into a boxed trait object that is !Sync.
Source§fn collect(self) -> Collect<Self> ⓘwhere
Self: Sized,
fn collect(self) -> Collect<Self> ⓘwhere
Self: Sized,
Turn this body into
Collected body which will collect all the DATA frames
and trailers.Source§fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
Add trailers to the body. Read more
Source§fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
Turn this body into
BodyDataStream.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request