pub struct WithBot<Inner>(/* private fields */);
Expand description
Adds a new “bot” value to the nested lattice type.
Given an existing lattice, wrap it into a new lattice with a new bottom element. The new bottom element compares as less than all the values of the wrapped lattice. This can be used for giving a sensible default/bottom element to lattices that don’t necessarily have one.
The implementation wraps an Option
, with None
representing the bottom element.
Implementations§
source§impl<Inner> WithBot<Inner>
impl<Inner> WithBot<Inner>
sourcepub fn new_from(val: impl Into<Option<Inner>>) -> Self
pub fn new_from(val: impl Into<Option<Inner>>) -> Self
Create a new WithBot
lattice instance from a value using Into
.
sourcepub fn as_reveal_ref(&self) -> Option<&Inner>
pub fn as_reveal_ref(&self) -> Option<&Inner>
Reveal the inner value as a shared reference.
sourcepub fn as_reveal_mut(&mut self) -> Option<&mut Inner>
pub fn as_reveal_mut(&mut self) -> Option<&mut Inner>
Reveal the inner value as an exclusive reference.
sourcepub fn into_reveal(self) -> Option<Inner>
pub fn into_reveal(self) -> Option<Inner>
Gets the inner by value, consuming self.
Trait Implementations§
source§impl<Inner> Atomize for WithBot<Inner>
impl<Inner> Atomize for WithBot<Inner>
source§impl<Inner> DeepReveal for WithBot<Inner>where
Inner: DeepReveal,
impl<Inner> DeepReveal for WithBot<Inner>where
Inner: DeepReveal,
source§fn deep_reveal(self) -> Self::Revealed
fn deep_reveal(self) -> Self::Revealed
Reveals the underlying lattice types recursively.
source§impl<'de, Inner> Deserialize<'de> for WithBot<Inner>where
Inner: Deserialize<'de>,
impl<'de, Inner> Deserialize<'de> for WithBot<Inner>where
Inner: 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<Inner, Other> LatticeFrom<WithBot<Other>> for WithBot<Inner>where
Inner: LatticeFrom<Other>,
impl<Inner, Other> LatticeFrom<WithBot<Other>> for WithBot<Inner>where
Inner: LatticeFrom<Other>,
source§fn lattice_from(other: WithBot<Other>) -> Self
fn lattice_from(other: WithBot<Other>) -> Self
Convert from the
Other
lattice into Self
.source§impl<Inner, Other> PartialOrd<WithBot<Other>> for WithBot<Inner>
impl<Inner, Other> PartialOrd<WithBot<Other>> for WithBot<Inner>
impl<Inner: Copy> Copy for WithBot<Inner>
impl<Inner> Eq for WithBot<Inner>where
Self: PartialEq,
impl<Inner, Other> LatticeOrd<WithBot<Other>> for WithBot<Inner>where
Self: PartialOrd<WithBot<Other>>,
Auto Trait Implementations§
impl<Inner> Freeze for WithBot<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for WithBot<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for WithBot<Inner>where
Inner: Send,
impl<Inner> Sync for WithBot<Inner>where
Inner: Sync,
impl<Inner> Unpin for WithBot<Inner>where
Inner: Unpin,
impl<Inner> UnwindSafe for WithBot<Inner>where
Inner: 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
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
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<This, Other> NaiveLatticeOrd<Other> for This
impl<This, Other> NaiveLatticeOrd<Other> for This
source§fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>
fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>
Naive compare based on the
Merge::merge
method. This method can be very inefficient;
use PartialOrd::partial_cmp
instead. Read more