Struct mesh_channel::OneshotReceiver
source · pub struct OneshotReceiver<T>(/* private fields */);
Expand description
The receiving half of a channel returned by oneshot
.
A value is received by poll
ing or await
ing the channel.
Implementations§
source§impl<T: MeshField> OneshotReceiver<T>
impl<T: MeshField> OneshotReceiver<T>
sourcepub fn upcast<U: MeshField>(self) -> OneshotReceiver<U> ⓘwhere
Self: Upcast<OneshotReceiver<U>>,
pub fn upcast<U: MeshField>(self) -> OneshotReceiver<U> ⓘwhere
Self: Upcast<OneshotReceiver<U>>,
Upcasts this receiver to one that can receive values whose encoding is a
superset of T
’s.
sourcepub fn force_downcast<U: MeshField>(self) -> OneshotReceiver<U> ⓘwhere
OneshotReceiver<U>: Upcast<Self>,
pub fn force_downcast<U: MeshField>(self) -> OneshotReceiver<U> ⓘwhere
OneshotReceiver<U>: Upcast<Self>,
Downcasts this receiver to one that can receive values whose encoding is
a subset of T
’s.
Although this is memory safe, it can cause decoding failures if the
associated sender sends values that don’t decode to U
.
Trait Implementations§
source§impl<T> Debug for OneshotReceiver<T>
impl<T> Debug for OneshotReceiver<T>
source§impl<T> DefaultEncoding for OneshotReceiver<T>where
T: MeshField,
impl<T> DefaultEncoding for OneshotReceiver<T>where
T: MeshField,
source§type Encoding = TableEncoder
type Encoding = TableEncoder
The encoding to use for the serialization. Read more
source§impl<T: MeshField> From<OneshotReceiver<T>> for Port
impl<T: MeshField> From<OneshotReceiver<T>> for Port
source§fn from(v: OneshotReceiver<T>) -> Self
fn from(v: OneshotReceiver<T>) -> Self
Converts to this type from the input type.
source§impl<T: 'static + Send> Future for OneshotReceiver<T>
impl<T: 'static + Send> Future for OneshotReceiver<T>
source§impl<'encoding, T> StructDecodeMetadata<'encoding, Resource> for OneshotReceiver<T>where
T: MeshField,
impl<'encoding, T> StructDecodeMetadata<'encoding, Resource> for OneshotReceiver<T>where
T: MeshField,
source§const DECODERS: &'static [ErasedDecoderEntry] = _
const DECODERS: &'static [ErasedDecoderEntry] = _
The list of decoder vtables.
source§impl<T> StructEncodeMetadata<Resource> for OneshotReceiver<T>where
T: MeshField,
impl<T> StructEncodeMetadata<Resource> for OneshotReceiver<T>where
T: MeshField,
source§const ENCODERS: &'static [ErasedEncoderEntry] = _
const ENCODERS: &'static [ErasedEncoderEntry] = _
The list of encoder vtables.
source§impl<T> StructMetadata for OneshotReceiver<T>where
T: MeshField,
impl<T> StructMetadata for OneshotReceiver<T>where
T: MeshField,
impl<T: MeshField, U: MeshField> Downcast<OneshotReceiver<U>> for OneshotReceiver<T>
Auto Trait Implementations§
impl<T> Freeze for OneshotReceiver<T>
impl<T> !RefUnwindSafe for OneshotReceiver<T>
impl<T> Send for OneshotReceiver<T>
impl<T> Sync for OneshotReceiver<T>
impl<T> Unpin for OneshotReceiver<T>
impl<T> !UnwindSafe for OneshotReceiver<T>
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
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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more
source§impl<T> SerializeMessage for Twhere
T: MeshPayload,
impl<T> SerializeMessage for Twhere
T: MeshPayload,
source§fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
Computes the message size, as in
MessageEncode::compute_message_size
.source§fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
Writes the message, as in
MessageEncode::write_message
.source§fn extract(self) -> <T as SerializeMessage>::Concrete
fn extract(self) -> <T as SerializeMessage>::Concrete
Extract the concrete message.