Struct static_cow::CowPhantom
source · pub struct CowPhantom<'a, B>where
B: ?Sized,{ /* private fields */ }Expand description
A zero-sized type which implements IntoOwning.
Structures with fields that are generic over StaticCow<'a, B> often
have no fields that directly mention 'a or B, so they need add a phantom
in order to placate the type checker, and the structure’s
to_owning and
into_owning methods will need to change the
phantom’s lifetime parameter. CowPhantom will do the right thing in this
respect so that you can simply call to_owning/into_owning on it just
like you would all the other fields in your structure.
Trait Implementations§
source§impl<'a, B> Default for CowPhantom<'a, B>where
B: 'a + ?Sized,
impl<'a, B> Default for CowPhantom<'a, B>where
B: 'a + ?Sized,
source§impl<'a, 'o, B> IntoOwning<'o> for CowPhantom<'a, B>where
B: 'o + ?Sized,
impl<'a, 'o, B> IntoOwning<'o> for CowPhantom<'a, B>where
B: 'o + ?Sized,
source§fn into_owning(self) -> Self::Owning
fn into_owning(self) -> Self::Owning
Converts an object which owns its contents into one which borrows them.
source§impl<'a, B> Ord for CowPhantom<'a, B>where
B: ?Sized + Ord,
impl<'a, B> Ord for CowPhantom<'a, B>where
B: ?Sized + Ord,
source§fn cmp(&self, other: &CowPhantom<'a, B>) -> Ordering
fn cmp(&self, other: &CowPhantom<'a, B>) -> 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<'a, B> PartialEq<CowPhantom<'a, B>> for CowPhantom<'a, B>where
B: ?Sized + PartialEq,
impl<'a, B> PartialEq<CowPhantom<'a, B>> for CowPhantom<'a, B>where
B: ?Sized + PartialEq,
source§fn eq(&self, other: &CowPhantom<'a, B>) -> bool
fn eq(&self, other: &CowPhantom<'a, B>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'a, B> PartialOrd<CowPhantom<'a, B>> for CowPhantom<'a, B>where
B: ?Sized + PartialOrd,
impl<'a, B> PartialOrd<CowPhantom<'a, B>> for CowPhantom<'a, B>where
B: ?Sized + PartialOrd,
source§fn partial_cmp(&self, other: &CowPhantom<'a, B>) -> Option<Ordering>
fn partial_cmp(&self, other: &CowPhantom<'a, B>) -> 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 more