pub struct Edge<S> {
pub from: String,
pub to: String,
pub condition: Arc<dyn Fn(&S) -> bool + Send + Sync>,
pub label: Option<String>,
}Expand description
An edge between two nodes with an optional condition.
Fields§
§from: StringSource node name.
to: StringTarget node name.
condition: Arc<dyn Fn(&S) -> bool + Send + Sync>Condition function.
label: Option<String>Edge label/description.
Implementations§
Source§impl<S> Edge<S>
impl<S> Edge<S>
Sourcepub fn new<F>(
from: impl Into<String>,
to: impl Into<String>,
condition: F,
) -> Self
pub fn new<F>( from: impl Into<String>, to: impl Into<String>, condition: F, ) -> Self
Create a new conditional edge.
Sourcepub fn unconditional(from: impl Into<String>, to: impl Into<String>) -> Self
pub fn unconditional(from: impl Into<String>, to: impl Into<String>) -> Self
Create an unconditional edge (always true).
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Add a label to the edge.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Edge<S>
impl<S> !RefUnwindSafe for Edge<S>
impl<S> Send for Edge<S>
impl<S> Sync for Edge<S>
impl<S> Unpin for Edge<S>
impl<S> !UnwindSafe for Edge<S>
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