Enum terminus_store::layer::PossiblyResolved
source · pub enum PossiblyResolved<T: Clone + PartialEq + Eq + PartialOrd + Ord + Hash> {
Unresolved(T),
Resolved(u64),
}Expand description
Either a resolved id or an unresolved inner type.
Variants§
Implementations§
source§impl<T: Clone + PartialEq + Eq + PartialOrd + Ord + Hash> PossiblyResolved<T>
impl<T: Clone + PartialEq + Eq + PartialOrd + Ord + Hash> PossiblyResolved<T>
sourcepub fn is_resolved(&self) -> bool
pub fn is_resolved(&self) -> bool
Returns true if this is a resolved id, and false otherwise.
sourcepub fn as_ref(&self) -> PossiblyResolved<&T>
pub fn as_ref(&self) -> PossiblyResolved<&T>
Return a PossiblyResolved with the inner value as a reference.
sourcepub fn unwrap_unresolved(self) -> T
pub fn unwrap_unresolved(self) -> T
Unwrap to the unresolved inner value, or panic if this was actually a resolved id.
sourcepub fn unwrap_resolved(self) -> u64
pub fn unwrap_resolved(self) -> u64
Unwrap to the resolved id, or panic if this was actually an unresolved value.
Trait Implementations§
source§impl<T: Clone + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Clone for PossiblyResolved<T>
impl<T: Clone + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Clone for PossiblyResolved<T>
source§fn clone(&self) -> PossiblyResolved<T>
fn clone(&self) -> PossiblyResolved<T>
Returns a copy 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 moresource§impl<T: Debug + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Debug for PossiblyResolved<T>
impl<T: Debug + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Debug for PossiblyResolved<T>
source§impl<T: Hash + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Hash for PossiblyResolved<T>
impl<T: Hash + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Hash for PossiblyResolved<T>
source§impl<T: Ord + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Ord for PossiblyResolved<T>
impl<T: Ord + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Ord for PossiblyResolved<T>
source§fn cmp(&self, other: &PossiblyResolved<T>) -> Ordering
fn cmp(&self, other: &PossiblyResolved<T>) -> Ordering
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 + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> PartialEq<PossiblyResolved<T>> for PossiblyResolved<T>
impl<T: PartialEq + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> PartialEq<PossiblyResolved<T>> for PossiblyResolved<T>
source§fn eq(&self, other: &PossiblyResolved<T>) -> bool
fn eq(&self, other: &PossiblyResolved<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: PartialOrd + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> PartialOrd<PossiblyResolved<T>> for PossiblyResolved<T>
impl<T: PartialOrd + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> PartialOrd<PossiblyResolved<T>> for PossiblyResolved<T>
source§fn partial_cmp(&self, other: &PossiblyResolved<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &PossiblyResolved<T>) -> Option<Ordering>
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: Eq + Clone + PartialEq + Eq + PartialOrd + Ord + Hash> Eq for PossiblyResolved<T>
impl<T: Clone + PartialEq + Eq + PartialOrd + Ord + Hash> StructuralEq for PossiblyResolved<T>
impl<T: Clone + PartialEq + Eq + PartialOrd + Ord + Hash> StructuralPartialEq for PossiblyResolved<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for PossiblyResolved<T>where
T: RefUnwindSafe,
impl<T> Send for PossiblyResolved<T>where
T: Send,
impl<T> Sync for PossiblyResolved<T>where
T: Sync,
impl<T> Unpin for PossiblyResolved<T>where
T: Unpin,
impl<T> UnwindSafe for PossiblyResolved<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.