Struct aws_smithy_eventstream::frame::MessageFrameDecoder
source · #[non_exhaustive]pub struct MessageFrameDecoder { /* private fields */ }
Expand description
Streaming decoder for decoding a Message
from a stream.
Implementations§
source§impl MessageFrameDecoder
impl MessageFrameDecoder
sourcepub fn decode_frame<B: Buf>(&mut self, buffer: B) -> Result<DecodedFrame, Error>
pub fn decode_frame<B: Buf>(&mut self, buffer: B) -> Result<DecodedFrame, Error>
Attempts to decode a Message
from the given buffer
. This function expects
to be called over and over again with more data in the buffer each time its called.
When there’s not enough data to decode a message, it returns Ok(None)
.
Once there is enough data to read a message prelude, then it will mutate the Buf
position. The state from the reading of the prelude is stored in the decoder so that
the next call will be able to decode the entire message, even though the prelude
is no longer available in the Buf
.
Trait Implementations§
source§impl Debug for MessageFrameDecoder
impl Debug for MessageFrameDecoder
source§impl Default for MessageFrameDecoder
impl Default for MessageFrameDecoder
source§fn default() -> MessageFrameDecoder
fn default() -> MessageFrameDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessageFrameDecoder
impl RefUnwindSafe for MessageFrameDecoder
impl Send for MessageFrameDecoder
impl Sync for MessageFrameDecoder
impl Unpin for MessageFrameDecoder
impl UnwindSafe for MessageFrameDecoder
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more