pub struct Dag<T> { /* private fields */ }
Expand description
DAG (Directed Acyclic Graph) for complex relationships
Implementations§
Source§impl<T: Clone + PartialEq> Dag<T>
impl<T: Clone + PartialEq> Dag<T>
Sourcepub fn add_node(&mut self, value: T) -> Result<PositionId, AdvancedCrdtError>
pub fn add_node(&mut self, value: T) -> Result<PositionId, AdvancedCrdtError>
Add a node
Sourcepub fn add_edge(
&mut self,
from: &PositionId,
to: &PositionId,
) -> Result<(), AdvancedCrdtError>
pub fn add_edge( &mut self, from: &PositionId, to: &PositionId, ) -> Result<(), AdvancedCrdtError>
Add an edge from source to target
Sourcepub fn remove_edge(
&mut self,
from: &PositionId,
to: &PositionId,
) -> Result<(), AdvancedCrdtError>
pub fn remove_edge( &mut self, from: &PositionId, to: &PositionId, ) -> Result<(), AdvancedCrdtError>
Remove an edge
Sourcepub fn delete_node(
&mut self,
node_id: &PositionId,
) -> Result<(), AdvancedCrdtError>
pub fn delete_node( &mut self, node_id: &PositionId, ) -> Result<(), AdvancedCrdtError>
Delete a node
Sourcepub fn topological_sort(&self) -> Vec<PositionId>
pub fn topological_sort(&self) -> Vec<PositionId>
Get topological sort of the DAG
Sourcepub fn get_nodes(&self) -> &HashMap<PositionId, DagNode<T>>
pub fn get_nodes(&self) -> &HashMap<PositionId, DagNode<T>>
Get all nodes (for debugging/inspection)
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Dag<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Dag<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T> StructuralPartialEq for Dag<T>
Auto Trait Implementations§
impl<T> Freeze for Dag<T>
impl<T> RefUnwindSafe for Dag<T>where
T: RefUnwindSafe,
impl<T> Send for Dag<T>where
T: Send,
impl<T> Sync for Dag<T>where
T: Sync,
impl<T> Unpin for Dag<T>where
T: Unpin,
impl<T> UnwindSafe for Dag<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromFormData for Twhere
T: DeserializeOwned,
impl<T> FromFormData for Twhere
T: DeserializeOwned,
Source§fn from_event(ev: &Event) -> Result<T, FromFormDataError>
fn from_event(ev: &Event) -> Result<T, FromFormDataError>
Tries to deserialize the data, given only the
submit
event.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.