pub struct Sender<T: 'static, S> { /* private fields */ }
Implementations§
source§impl<T: Transmittable, S: Synchronizer> Sender<T, S>
impl<T: Transmittable, S: Synchronizer> Sender<T, S>
sourcepub unsafe fn from_descriptor(d: FifoDescriptor<T>, synchronizer: S) -> Self
pub unsafe fn from_descriptor(d: FifoDescriptor<T>, synchronizer: S) -> Self
Create a Sender
from a FifoDescriptor
and Synchronizer
.
§Safety
The caller must ensure the following:
-
The
data
andlen
fields inFifoDescriptor
must adhere to all safety requirements described instd::slice::from_raw_parts_mut()
-
The
offsets
field inFifoDescriptor
must be non-null and point to a valid memory location holding anAtomicUsize
. -
The synchronizer must somehow know how to correctly synchronize with the other end of the channel.
pub fn try_send(&self, val: Identified<T>) -> Result<(), TrySendError>
sourcepub fn try_send_multiple(
&self,
values: &[Identified<T>]
) -> Result<usize, TrySendError>
pub fn try_send_multiple( &self, values: &[Identified<T>] ) -> Result<usize, TrySendError>
Tries to send multiple values. Calling this function has the same
semantics as calling try_send
for each item in order until an error
occurs, but it has the benefit of notifying the receiver at most once.
Returns the number of successfully sent items if any item was successfully sent, otherwise returns an error.
pub fn send(&self, val: Identified<T>) -> Result<(), SendError>
Trait Implementations§
impl<T: Send, S: Send> Send for Sender<T, S>
impl<T: Send, S: Sync> Sync for Sender<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for Sender<T, S>where
S: Freeze,
impl<T, S> !RefUnwindSafe for Sender<T, S>
impl<T, S> Unpin for Sender<T, S>where
S: Unpin,
impl<T, S> !UnwindSafe for Sender<T, S>
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