pub struct Conflict<T>(/* private fields */);
Expand description
A Conflict
lattice, stores a single instance of T
and goes to a “conflict” state (None
)
if inequal T
instances are merged together.
Like Point<T>
, but will go to “conflict” (top/None
) instead of panicking.
Can be thought of as a lattice with a domain of size one, corresponding to the specific value inside.
This can be used to wrap non-lattice (scalar) data into a lattice type.
Implementations§
source§impl<T> Conflict<T>
impl<T> Conflict<T>
sourcepub fn new_from(val: impl Into<Option<T>>) -> Self
pub fn new_from(val: impl Into<Option<T>>) -> Self
Create a new Conflict
lattice instance from a value using Into
.
sourcepub fn as_reveal_ref(&self) -> Option<&T>
pub fn as_reveal_ref(&self) -> Option<&T>
Reveal the inner value as a shared reference.
sourcepub fn as_reveal_mut(&mut self) -> Option<&mut T>
pub fn as_reveal_mut(&mut self) -> Option<&mut T>
Reveal the inner value as an exclusive reference.
sourcepub fn into_reveal(self) -> Option<T>
pub fn into_reveal(self) -> Option<T>
Gets the inner by value, consuming self.
Trait Implementations§
source§impl<T> DeepReveal for Conflict<T>
impl<T> DeepReveal for Conflict<T>
source§impl<'de, T> Deserialize<'de> for Conflict<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Conflict<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> LatticeFrom<Conflict<T>> for Conflict<T>
impl<T> LatticeFrom<Conflict<T>> for Conflict<T>
source§fn lattice_from(other: Conflict<T>) -> Self
fn lattice_from(other: Conflict<T>) -> Self
Convert from the
Other
lattice into Self
.source§impl<T, O> PartialOrd<Conflict<O>> for Conflict<T>where
T: PartialEq<O>,
impl<T, O> PartialOrd<Conflict<O>> for Conflict<T>where
T: PartialEq<O>,
impl<T: Copy> Copy for Conflict<T>
impl<T: Eq> Eq for Conflict<T>
impl<T, O> LatticeOrd<Conflict<O>> for Conflict<T>where
Self: PartialOrd<Conflict<O>>,
Auto Trait Implementations§
impl<T> Freeze for Conflict<T>where
T: Freeze,
impl<T> RefUnwindSafe for Conflict<T>where
T: RefUnwindSafe,
impl<T> Send for Conflict<T>where
T: Send,
impl<T> Sync for Conflict<T>where
T: Sync,
impl<T> Unpin for Conflict<T>where
T: Unpin,
impl<T> UnwindSafe for Conflict<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
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