pub struct SimilaritySessionGraph { /* private fields */ }Expand description
A graph that controls node processing order and cannot contain cycles.
Nodes and edges cannot be changed during a run.
Implementations§
Source§impl SimilaritySessionGraph
impl SimilaritySessionGraph
pub unsafe fn ref_from_raw(handle: *mut BNSimilaritySessionGraph) -> Ref<Self>
Sourcepub fn add_node(&self, node: &SimilaritySessionNode)
pub fn add_node(&self, node: &SimilaritySessionNode)
Adds a node, moving it from its current graph if necessary.
If either graph is running, the node is unchanged.
Sourcepub fn remove_node(&self, node: &SimilaritySessionNode)
pub fn remove_node(&self, node: &SimilaritySessionNode)
Removes a node and its edges from the graph.
Sourcepub fn node(
&self,
id: SimilaritySessionNodeId,
) -> Option<Ref<SimilaritySessionNode>>
pub fn node( &self, id: SimilaritySessionNodeId, ) -> Option<Ref<SimilaritySessionNode>>
Returns a node by ID.
Sourcepub fn nodes(&self) -> Array<SimilaritySessionNode>
pub fn nodes(&self) -> Array<SimilaritySessionNode>
Returns all nodes in the graph.
Sourcepub fn is_valid_edge(
&self,
from: &SimilaritySessionNode,
to: &SimilaritySessionNode,
) -> bool
pub fn is_valid_edge( &self, from: &SimilaritySessionNode, to: &SimilaritySessionNode, ) -> bool
Returns whether an edge can be added without creating a cycle.
Sourcepub fn add_edge(
&self,
from: &SimilaritySessionNode,
to: &SimilaritySessionNode,
) -> bool
pub fn add_edge( &self, from: &SimilaritySessionNode, to: &SimilaritySessionNode, ) -> bool
Adds an edge if both nodes are present and it would not create a cycle.
Sourcepub fn remove_edge(
&self,
from: &SimilaritySessionNode,
to: &SimilaritySessionNode,
) -> bool
pub fn remove_edge( &self, from: &SimilaritySessionNode, to: &SimilaritySessionNode, ) -> bool
Removes an edge from the graph.
Sourcepub fn add_receiver(&self, receiver: &CoreSimilaritySessionGraphReceiver)
pub fn add_receiver(&self, receiver: &CoreSimilaritySessionGraphReceiver)
Adds a graph-change receiver.
Sourcepub fn remove_receiver(&self, receiver: &CoreSimilaritySessionGraphReceiver)
pub fn remove_receiver(&self, receiver: &CoreSimilaritySessionGraphReceiver)
Removes a graph-change receiver.
Sourcepub fn receivers(&self) -> Array<CoreSimilaritySessionGraphReceiver>
pub fn receivers(&self) -> Array<CoreSimilaritySessionGraphReceiver>
Returns the graph-change receivers registered with this graph.
Trait Implementations§
Source§impl ToOwned for SimilaritySessionGraph
impl ToOwned for SimilaritySessionGraph
Source§type Owned = Ref<SimilaritySessionGraph>
type Owned = Ref<SimilaritySessionGraph>
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
Auto Trait Implementations§
impl Freeze for SimilaritySessionGraph
impl RefUnwindSafe for SimilaritySessionGraph
impl !Send for SimilaritySessionGraph
impl !Sync for SimilaritySessionGraph
impl Unpin for SimilaritySessionGraph
impl UnsafeUnpin for SimilaritySessionGraph
impl UnwindSafe for SimilaritySessionGraph
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more