pub struct AtomicSwitchCtrl<O = (), E = Never>(/* private fields */);Expand description
Handle to AtomicSwitch that controls it.
Implementations§
Source§impl<O, E> AtomicSwitchCtrl<O, E>
impl<O, E> AtomicSwitchCtrl<O, E>
Sourcepub fn get(&self) -> Arc<Box<dyn SendSyncRefUnwindSafeDrain<Ok = O, Err = E>>>
pub fn get(&self) -> Arc<Box<dyn SendSyncRefUnwindSafeDrain<Ok = O, Err = E>>>
Get Arc to the currently wrapped drain
Sourcepub fn set<D: SendSyncRefUnwindSafeDrain<Ok = O, Err = E> + 'static>(
&self,
drain: D,
)
pub fn set<D: SendSyncRefUnwindSafeDrain<Ok = O, Err = E> + 'static>( &self, drain: D, )
Set the current wrapped drain
Sourcepub fn swap(
&self,
drain: Arc<Box<dyn SendSyncRefUnwindSafeDrain<Ok = O, Err = E>>>,
) -> Arc<Box<dyn SendSyncRefUnwindSafeDrain<Ok = O, Err = E>>>
pub fn swap( &self, drain: Arc<Box<dyn SendSyncRefUnwindSafeDrain<Ok = O, Err = E>>>, ) -> Arc<Box<dyn SendSyncRefUnwindSafeDrain<Ok = O, Err = E>>>
Swap the existing drain with a new one
Sourcepub fn drain(&self) -> AtomicSwitch<O, E>
pub fn drain(&self) -> AtomicSwitch<O, E>
Get a AtomicSwitch drain controlled by this AtomicSwitchCtrl
Trait Implementations§
Source§impl<O: Clone, E: Clone> Clone for AtomicSwitchCtrl<O, E>
impl<O: Clone, E: Clone> Clone for AtomicSwitchCtrl<O, E>
Source§fn clone(&self) -> AtomicSwitchCtrl<O, E>
fn clone(&self) -> AtomicSwitchCtrl<O, E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<O, E> Freeze for AtomicSwitchCtrl<O, E>
impl<O, E> RefUnwindSafe for AtomicSwitchCtrl<O, E>
impl<O, E> Send for AtomicSwitchCtrl<O, E>
impl<O, E> Sync for AtomicSwitchCtrl<O, E>
impl<O, E> Unpin for AtomicSwitchCtrl<O, E>
impl<O, E> UnwindSafe for AtomicSwitchCtrl<O, E>
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