pub enum CapabilityState<T> {
Absent,
Cancelled,
Value(T),
}Expand description
Presence state preserved by source and binary round trips.
Variants§
Absent
Capability has no stored value.
Cancelled
Capability is explicitly cancelled.
Value(T)
Capability has a concrete value.
Implementations§
Source§impl<T> CapabilityState<T>
impl<T> CapabilityState<T>
Sourcepub const fn is_cancelled(&self) -> bool
pub const fn is_cancelled(&self) -> bool
Reports whether the capability is cancelled.
Sourcepub fn as_ref(&self) -> CapabilityState<&T>
pub fn as_ref(&self) -> CapabilityState<&T>
Borrows a concrete value while preserving presence state.
Trait Implementations§
Source§impl<T: Clone> Clone for CapabilityState<T>
impl<T: Clone> Clone for CapabilityState<T>
Source§impl<T: Debug> Debug for CapabilityState<T>
impl<T: Debug> Debug for CapabilityState<T>
Source§impl<T> Default for CapabilityState<T>
impl<T> Default for CapabilityState<T>
impl<T: Eq> Eq for CapabilityState<T>
Source§impl<T: PartialEq> PartialEq for CapabilityState<T>
impl<T: PartialEq> PartialEq for CapabilityState<T>
impl<T: PartialEq> StructuralPartialEq for CapabilityState<T>
Auto Trait Implementations§
impl<T> Freeze for CapabilityState<T>where
T: Freeze,
impl<T> RefUnwindSafe for CapabilityState<T>where
T: RefUnwindSafe,
impl<T> Send for CapabilityState<T>where
T: Send,
impl<T> Sync for CapabilityState<T>where
T: Sync,
impl<T> Unpin for CapabilityState<T>where
T: Unpin,
impl<T> UnsafeUnpin for CapabilityState<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CapabilityState<T>where
T: UnwindSafe,
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