Skip to main content

ReceivedMessage

Struct ReceivedMessage 

Source
pub struct ReceivedMessage<'a, T: 'a, C: CodecFor<T>> { /* private fields */ }
Expand description

A handle to a decoded received message.

For an owning codec such as consortium_codec::PostcardCodec (Decoded<'buf> = T) this owns the decoded T - the 'a lifetime is unused and the value can be moved out freely via into_inner.

For a future zero-copy codec 'a will borrow the channel’s internal receive buffer, preventing a second recv() call while this handle is live. Application code using Deref does not need to change.

Implementations§

Source§

impl<'a, T, C: CodecFor<T>> ReceivedMessage<'a, T, C>

Source

pub fn into_inner(self) -> C::Decoded<'a>

Consume the handle and return the inner decoded value.

Trait Implementations§

Source§

impl<'a, T, C> Debug for ReceivedMessage<'a, T, C>
where C: CodecFor<T>, C::Decoded<'a>: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T, C> Deref for ReceivedMessage<'a, T, C>
where C: CodecFor<T>, C::Decoded<'a>: Deref<Target = T>, T: 'a,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, T, C> Freeze for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: Freeze,

§

impl<'a, T, C> RefUnwindSafe for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: RefUnwindSafe, T: RefUnwindSafe,

§

impl<'a, T, C> Send for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: Send, T: Sync,

§

impl<'a, T, C> Sync for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: Sync, T: Sync,

§

impl<'a, T, C> Unpin for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: Unpin,

§

impl<'a, T, C> UnsafeUnpin for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: UnsafeUnpin,

§

impl<'a, T, C> UnwindSafe for ReceivedMessage<'a, T, C>
where <C as CodecFor<T>>::Decoded<'a>: UnwindSafe, T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> MaybeSend for T

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.