Struct orx_selfref_col::NodeRefSingle
source · 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>,
impl<'a, V, T> Clone for NodeRefSingle<'a, V, T>where
V: Variant<'a, T>,
source§impl<'a, V, T> Default for NodeRefSingle<'a, V, T>where
V: Variant<'a, T>,
impl<'a, V, T> Default for NodeRefSingle<'a, V, T>where
V: Variant<'a, T>,
source§impl<'a, V, T> From<Option<&'a Node<'a, V, T>>> for NodeRefSingle<'a, V, T>where
V: Variant<'a, T>,
impl<'a, V, T> From<Option<&'a Node<'a, V, T>>> for NodeRefSingle<'a, V, T>where
V: Variant<'a, T>,
source§impl<'a, V, T> NodeRefs<'a, V, T> for NodeRefSingle<'a, V, T>where
V: Variant<'a, T>,
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 References = Option<&'a Node<'a, V, T>>
Type of the underlying references.
source§fn new(references: Self::References) -> Self
fn new(references: Self::References) -> Self
Creates a new node references for the given
references
.source§fn get(&self) -> &Self::References
fn get(&self) -> &Self::References
Returns a reference to the underlying references.
source§fn get_mut(&mut self) -> &mut Self::References
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>
)
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,
fn referenced_nodes(&self) -> impl Iterator<Item = &'a Node<'a, V, T>>where
V: 'a,
T: 'a,
Returns an iterator to the referenced nodes.
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>
impl<'a, V, T> Sync for NodeRefSingle<'a, V, T>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more