Enum segment_tree::maybe_owned::MaybeOwned
[−]
[src]
pub enum MaybeOwned<'a, T: 'a> { Borrowed(&'a T), Owned(T), }
Variants
Borrowed(&'a T)
Owned(T)
Methods
impl<'a, T: 'a> MaybeOwned<'a, T>
[src]
fn as_ref<'b>(&'b self) -> &'b T where
'b: 'a,
'b: 'a,
Get a reference to the contained value.
impl<'a, T: 'a + Clone> MaybeOwned<'a, T>
[src]
fn get_or_clone(self) -> T
Get the value, cloning if necessary.
Trait Implementations
impl<'a, T: 'a + Debug> Debug for MaybeOwned<'a, T>
[src]
impl<'a, T: 'a + Display> Display for MaybeOwned<'a, T>
[src]
impl<'a, T: 'a + PartialEq> PartialEq for MaybeOwned<'a, T>
[src]
fn eq(&self, other: &MaybeOwned<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MaybeOwned<T>) -> bool
This method tests for !=
.
impl<'a, T: 'a + Eq> Eq for MaybeOwned<'a, T>
[src]
impl<'a, T: 'a + PartialOrd> PartialOrd for MaybeOwned<'a, T>
[src]
fn partial_cmp(&self, other: &MaybeOwned<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &MaybeOwned<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &MaybeOwned<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &MaybeOwned<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &MaybeOwned<T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, T: 'a + Ord> Ord for MaybeOwned<'a, T>
[src]
fn cmp(&self, other: &MaybeOwned<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
ord_max_min
)Compares and returns the minimum of two values. Read more
impl<'a, T: 'a + Default> Default for MaybeOwned<'a, T>
[src]
fn default() -> MaybeOwned<'a, T>
Returns the "default value" for a type. Read more