Struct scell::SCell
[−]
[src]
pub struct SCell<T: ?Sized>(_);
A smart container for objects in recursive data structures
This container contains Rc and therefore clone()
will create a new reference to the same instance.
Methods
impl<T> SCell<T>
[src]
fn new(t: T) -> Self
impl<T: ?Sized> SCell<T>
[src]
fn borrow(&self) -> Ref<T>
fn borrow_mut(&self) -> RefMut<T>
Trait Implementations
impl<T: Default + ?Sized> Default for SCell<T>
[src]
impl<T: ?Sized> Clone for SCell<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
impl<T: ?Sized> Pointer for SCell<T>
[src]
impl<T: ?Sized> PartialEq for SCell<T> where
T: PartialEq,
[src]
T: PartialEq,
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Self) -> bool
This method tests for !=
.
impl<T: ?Sized> Eq for SCell<T> where
T: Eq,
[src]
T: Eq,
impl<T: ?Sized> PartialOrd for SCell<T> where
T: PartialOrd,
[src]
T: PartialOrd,
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Self) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Self) -> 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: &Self) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Self) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: ?Sized> Ord for SCell<T> where
T: Ord,
[src]
T: Ord,
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<T: ?Sized> Hash for SCell<T> where
T: Hash,
[src]
T: Hash,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: ?Sized> Display for SCell<T> where
T: Display,
[src]
T: Display,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T: ?Sized> Debug for SCell<T> where
T: Debug,
[src]
T: Debug,
impl<T> From<T> for SCell<T>
[src]
fn from(t: T) -> Self
Performs the conversion.