Enum libpasta::primitives::Sod
[−]
[src]
pub enum Sod<T: ?Sized + 'static> {
Static(&'static T),
Dynamic(Arc<Box<T>>),
}Enum to hold either static references or reference-counted owned objects.
Implements Deref to T for ease of use.
Since internal data is either a static reference, or an Arc, cloning
is a cheap operation.
Variants
Static(&'static T)Static reference to T
Dynamic(Arc<Box<T>>)Dynamically allocated T, on the heap, atomically reference-counted.
Trait Implementations
impl<T: PartialEq + ?Sized + 'static> PartialEq for Sod<T>[src]
fn eq(&self, __arg_0: &Sod<T>) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Sod<T>) -> bool
This method tests for !=.
impl<T: PartialOrd + ?Sized + 'static> PartialOrd for Sod<T>[src]
fn partial_cmp(&self, __arg_0: &Sod<T>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &Sod<T>) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &Sod<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, __arg_0: &Sod<T>) -> bool
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &Sod<T>) -> bool
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<T: ?Sized> Deref for Sod<T>[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<T: ?Sized> Clone for Sod<T>[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more