Trait orx_selfref_col::NodeRefs
source · pub trait NodeRefs<'a, V, T>: Default + Clonewhere
V: Variant<'a, T>,{
type References;
// Required methods
fn new(references: Self::References) -> Self;
fn get(&self) -> &Self::References;
fn get_mut(&mut self) -> &mut Self::References;
fn update_reference(
&mut self,
prior_reference: &'a Node<'a, V, T>,
new_reference: &'a Node<'a, V, T>
);
fn referenced_nodes(&self) -> impl Iterator<Item = &'a Node<'a, V, T>>
where V: 'a,
T: 'a;
// Provided method
fn empty() -> Self { ... }
}
Expand description
Trait defining how the references of a self referential collection node will be stored.
Required Associated Types§
sourcetype References
type References
Type of the underlying references.
Required Methods§
sourcefn new(references: Self::References) -> Self
fn new(references: Self::References) -> Self
Creates a new node references for the given references
.
sourcefn get(&self) -> &Self::References
fn get(&self) -> &Self::References
Returns a reference to the underlying references.
sourcefn get_mut(&mut self) -> &mut Self::References
fn get_mut(&mut self) -> &mut Self::References
Returns a mutable reference to the underlying references.
sourcefn 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
.
sourcefn 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.
Provided Methods§
Object Safety§
This trait is not object safe.