Struct lattices::collections::OptionSet
source · #[repr(transparent)]pub struct OptionSet<T>(pub Option<T>);
Expand description
A wrapper around Option
, representing either a singleton or empty set.
Tuple Fields§
§0: Option<T>
Trait Implementations§
source§impl<T> CollectionRef for OptionSet<T>
impl<T> CollectionRef for OptionSet<T>
§type ItemRef<'a> = &'a <OptionSet<T> as Collection>::Item
where
Self: 'a
type ItemRef<'a> = &'a <OptionSet<T> as Collection>::Item where Self: 'a
Type of references to items of the collection.
source§fn upcast_item_ref<'short, 'long: 'short>(
r: Self::ItemRef<'long>
) -> Self::ItemRef<'short>where
Self: 'long,
fn upcast_item_ref<'short, 'long: 'short>(
r: Self::ItemRef<'long>
) -> Self::ItemRef<'short>where
Self: 'long,
Changes an item reference into a shorter lived reference. Read more
source§impl<'de, T> Deserialize<'de> for OptionSet<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for OptionSet<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> IntoIterator for OptionSet<T>
impl<T> IntoIterator for OptionSet<T>
source§impl<T: Ord> Ord for OptionSet<T>
impl<T: Ord> Ord for OptionSet<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq for OptionSet<T>
impl<T: PartialEq> PartialEq for OptionSet<T>
source§impl<T: PartialOrd> PartialOrd for OptionSet<T>
impl<T: PartialOrd> PartialOrd for OptionSet<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy> Copy for OptionSet<T>
impl<T: Eq> Eq for OptionSet<T>
impl<T> StructuralPartialEq for OptionSet<T>
Auto Trait Implementations§
impl<T> Freeze for OptionSet<T>where
T: Freeze,
impl<T> RefUnwindSafe for OptionSet<T>where
T: RefUnwindSafe,
impl<T> Send for OptionSet<T>where
T: Send,
impl<T> Sync for OptionSet<T>where
T: Sync,
impl<T> Unpin for OptionSet<T>where
T: Unpin,
impl<T> UnwindSafe for OptionSet<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