Struct mesh_channel::cell::Cell
source · pub struct Cell<T: MeshField + Sync + Clone>(/* private fields */);
Expand description
A cell containing a value that can be updated from a remote node.
Created by cell()
.
Implementations§
source§impl<T: MeshField + Sync + Clone> Cell<T>
impl<T: MeshField + Sync + Clone> Cell<T>
sourcepub fn with<F, R>(&self, f: F) -> R
pub fn with<F, R>(&self, f: F) -> R
Runs f
with a reference to the cell’s current value.
While f
is running, updates to the cell’s value will not be
acknowledged (and the remote updater’s set
method will block).
Trait Implementations§
source§impl<T> DefaultEncoding for Cell<T>
impl<T> DefaultEncoding for Cell<T>
source§type Encoding = TableEncoder
type Encoding = TableEncoder
The encoding to use for the serialization. Read more
source§impl<'encoding, T> StructDecodeMetadata<'encoding, Resource> for Cell<T>
impl<'encoding, T> StructDecodeMetadata<'encoding, Resource> for Cell<T>
source§const DECODERS: &'static [ErasedDecoderEntry] = _
const DECODERS: &'static [ErasedDecoderEntry] = _
The list of decoder vtables.
source§impl<T> StructEncodeMetadata<Resource> for Cell<T>
impl<T> StructEncodeMetadata<Resource> for Cell<T>
source§const ENCODERS: &'static [ErasedEncoderEntry] = _
const ENCODERS: &'static [ErasedEncoderEntry] = _
The list of encoder vtables.
source§impl<T> StructMetadata for Cell<T>
impl<T> StructMetadata for Cell<T>
impl<T> Downcast<Cell<T>> for Cell<T>
Auto Trait Implementations§
impl<T> Freeze for Cell<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Cell<T>
impl<T> Send for Cell<T>
impl<T> Sync for Cell<T>
impl<T> Unpin for Cell<T>where
T: Unpin,
impl<T> !UnwindSafe for Cell<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> 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.