Struct crossbeam_channel::context::Context
source · pub struct Context {
inner: Arc<Inner>,
}
Expand description
Thread-local context used in select.
Fields§
§inner: Arc<Inner>
Implementations§
source§impl Context
impl Context
sourcepub fn try_select(&self, select: Selected) -> Result<(), Selected>
pub fn try_select(&self, select: Selected) -> Result<(), Selected>
Attempts to select an operation.
On failure, the previously selected operation is returned.
sourcepub fn store_packet(&self, packet: *mut ())
pub fn store_packet(&self, packet: *mut ())
Stores a packet.
This method must be called after try_select
succeeds and there is a packet to provide.
sourcepub fn wait_packet(&self) -> *mut ()
pub fn wait_packet(&self) -> *mut ()
Waits until a packet is provided and returns it.
sourcepub fn wait_until(&self, deadline: Option<Instant>) -> Selected
pub fn wait_until(&self, deadline: Option<Instant>) -> Selected
Waits until an operation is selected and returns it.
If the deadline is reached, Selected::Aborted
will be selected.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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
)