Struct orx_selfref_col::NodeRefsVec
source · pub struct NodeRefsVec<'a, V, T>(/* private fields */)
where
V: Variant<'a, T>;
Expand description
A dynamic number of node references.
Underlying reference storage is a vector of references to the referenced nodes.
The following are some example references which can be expressed by NodeRefsVec
:
- children of a node in a tree;
- head (tail) nodes of edges outgoing from (incoming to) a node in a graph.
Trait Implementations§
source§impl<'a, V, T> Clone for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
impl<'a, V, T> Clone for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
source§impl<'a, V, T> Default for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
impl<'a, V, T> Default for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
source§impl<'a, V, T> From<Vec<&'a Node<'a, V, T>>> for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
impl<'a, V, T> From<Vec<&'a Node<'a, V, T>>> for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
source§impl<'a, V, T> NodeRefs<'a, V, T> for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
impl<'a, V, T> NodeRefs<'a, V, T> for NodeRefsVec<'a, V, T>where
V: Variant<'a, T>,
§type References = Vec<&'a Node<'a, V, T>>
type References = Vec<&'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 NodeRefsVec<'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 NodeRefsVec<'a, V, T>
impl<'a, V, T> Sync for NodeRefsVec<'a, V, T>
impl<'a, V, T> Unpin for NodeRefsVec<'a, V, T>
impl<'a, V, T> UnwindSafe for NodeRefsVec<'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