pub struct Shard<T> { /* private fields */ }
Expand description
The structure which is used to communicate with other peers from the Mesh.
Implementations§
Source§impl<T> Shard<T>
impl<T> Shard<T>
Sourcepub fn receiver(&self) -> Option<Receiver<T>>
pub fn receiver(&self) -> Option<Receiver<T>>
Take the receiver of this shard.
Shard are implemented using mpsc
channels, so only one Receiver can
receiving values from the other shards.
Sourcepub fn send_to(&self, val: T, shard: usize) -> Result<(), SenderError>
pub fn send_to(&self, val: T, shard: usize) -> Result<(), SenderError>
Send a value to the proper shard
Fail if this Shard did not join yet.
Sourcepub fn send_to_unchecked(&self, val: T, shard: usize)
pub fn send_to_unchecked(&self, val: T, shard: usize)
Send a value to a shard
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Shard<T>
impl<T> !RefUnwindSafe for Shard<T>
impl<T> Send for Shard<T>where
T: Send,
impl<T> !Sync for Shard<T>
impl<T> Unpin for Shard<T>
impl<T> !UnwindSafe for Shard<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