Struct vortex_ipc::messages::MessageDecoder
source · pub struct MessageDecoder { /* private fields */ }
Expand description
A stateful reader for decoding IPC messages from an arbitrary stream of bytes.
NOTE(ngates): we should design some trait that the Decoder can take that doesn’t require unique
ownership of the underlying bytes. The decoder needs to split out bytes, and advance a cursor,
but it doesn’t need to mutate any bytes. So in theory, we should be able to do this zero-copy
over a shared buffer of bytes, instead of requiring a BytesMut
.
Implementations§
source§impl MessageDecoder
impl MessageDecoder
sourcepub fn read_next(&mut self, bytes: &mut BytesMut) -> VortexResult<PollRead>
pub fn read_next(&mut self, bytes: &mut BytesMut) -> VortexResult<PollRead>
Attempt to read the next message from the bytes object.
If the message is incomplete, the function will return NeedMore
with the total number
of bytes needed to make progress. The next call to read_next should provide at least
this number of bytes otherwise it will be given the same NeedMore
response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MessageDecoder
impl RefUnwindSafe for MessageDecoder
impl Send for MessageDecoder
impl Sync for MessageDecoder
impl Unpin for MessageDecoder
impl UnwindSafe for MessageDecoder
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