pub struct Sender<T: MachineImpl> {
pub sender: Sender<T>,
/* private fields */
}
Expand description
Wrap the crossbeam sender to allow the executor to handle a block. This requires that a send which would block, parks the send. It also requires that prior to sending a check is made to determine if the sender is already blocked. What makes this work is that the repeat send is bound to the executor. Consequently, TLS data can be inspected to determine if we need to not complete the send.
Otherwise, the Sender is a wrapper aruond the Crossbeam sender. It intentionally limits the surface of the sender. Much of this is just boilerplate wrapping
Fields§
§sender: Sender<T>
Implementations§
Source§impl<T> Sender<T>where
T: MachineImpl,
impl<T> Sender<T>where
T: MachineImpl,
pub fn get_id(&self) -> usize
pub fn bind(&mut self, recevier_machine: Weak<MachineAdapter>)
pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>>
pub fn sender(&self) -> Sender<T>
pub fn send(&self, msg: T) -> Result<(), SendError<T>>where
T: MachineImpl + MachineImpl<InstructionSet = T> + Debug,
pub fn send_timeout( &self, msg: T, timeout: Duration, ) -> Result<(), SendTimeoutError<T>>
pub fn is_full(&self) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> Option<usize>
Trait Implementations§
impl<T> Eq for Sender<T>where
T: MachineImpl,
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> !UnwindSafe for Sender<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