pub struct NodeRefSingle<'a, V, T>(/* private fields */)
where
    V: Variant<'a, T>;
Expand description

A single node reference.

Underlying reference storage is an optional reference to the single referenced node.

The following are some example references which can be expressed by NodeRefSingle:

  • previous or next node in a linked list;
  • parent of a node in a tree.

Trait Implementations§

source§

impl<'a, V, T> Clone for NodeRefSingle<'a, V, T>
where V: Variant<'a, T>,

source§

fn clone(&self) -> Self

Clones the reference.

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T: Debug, V> Debug for NodeRefSingle<'a, V, T>
where V: Variant<'a, T>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, V, T> Default for NodeRefSingle<'a, V, T>
where V: Variant<'a, T>,

source§

fn default() -> Self

Creates an empty reference.

source§

impl<'a, V, T> From<&'a Node<'a, V, T>> for NodeRefSingle<'a, V, T>
where V: Variant<'a, T>,

source§

fn from(single_reference: &'a Node<'a, V, T>) -> Self

Converts to this type from the input type.
source§

impl<'a, V, T> From<Option<&'a Node<'a, V, T>>> for NodeRefSingle<'a, V, T>
where V: Variant<'a, T>,

source§

fn from(value: Option<&'a Node<'a, V, T>>) -> Self

Converts to this type from the input type.
source§

impl<'a, V, T> NodeRefs<'a, V, T> for NodeRefSingle<'a, V, T>
where V: Variant<'a, T>,

§

type References = Option<&'a Node<'a, V, T>>

Type of the underlying references.
source§

fn new(references: Self::References) -> Self

Creates a new node references for the given references.
source§

fn get(&self) -> &Self::References

Returns a reference to the underlying references.
source§

fn get_mut(&mut self) -> &mut Self::References

Returns a mutable reference to the underlying references.
source§

fn update_reference( &mut self, prior_reference: &'a Node<'a, V, T>, new_reference: &'a Node<'a, V, T> )

Updates this reference so that all internal references to the prior_reference are updated as new_reference. Does nothing if this NodeRefs does not hold a reference to the prior_reference.
source§

fn referenced_nodes(&self) -> impl Iterator<Item = &'a Node<'a, V, T>>
where V: 'a, T: 'a,

Returns an iterator to the referenced nodes.
source§

fn empty() -> Self

Creates empty references.

Auto Trait Implementations§

§

impl<'a, V, T> RefUnwindSafe for NodeRefSingle<'a, V, T>
where <V as Variant<'a, T>>::Next: RefUnwindSafe, <V as Variant<'a, T>>::Prev: RefUnwindSafe, <V as Variant<'a, T>>::Storage: RefUnwindSafe,

§

impl<'a, V, T> Send for NodeRefSingle<'a, V, T>
where <V as Variant<'a, T>>::Next: Sync, <V as Variant<'a, T>>::Prev: Sync, <V as Variant<'a, T>>::Storage: Sync,

§

impl<'a, V, T> Sync for NodeRefSingle<'a, V, T>
where <V as Variant<'a, T>>::Next: Sync, <V as Variant<'a, T>>::Prev: Sync, <V as Variant<'a, T>>::Storage: Sync,

§

impl<'a, V, T> Unpin for NodeRefSingle<'a, V, T>

§

impl<'a, V, T> UnwindSafe for NodeRefSingle<'a, V, T>
where <V as Variant<'a, T>>::Next: RefUnwindSafe, <V as Variant<'a, T>>::Prev: RefUnwindSafe, <V as Variant<'a, T>>::Storage: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V