pub struct ConditionalFlow<C: Callable> { /* private fields */ }Expand description
Conditional execution flow
Implementations§
Source§impl<C: Callable> ConditionalFlow<C>
impl<C: Callable> ConditionalFlow<C>
Sourcepub fn add_branch(self, branch: Branch<C>) -> Self
pub fn add_branch(self, branch: Branch<C>) -> Self
Add a conditional branch
Sourcepub fn when(
self,
name: impl Into<String>,
condition: impl Fn(&str) -> bool + Send + Sync + 'static,
callable: Arc<C>,
) -> Self
pub fn when( self, name: impl Into<String>, condition: impl Fn(&str) -> bool + Send + Sync + 'static, callable: Arc<C>, ) -> Self
Add a condition with callable
Sourcepub async fn execute(&self, input: &str) -> Result<String>
pub async fn execute(&self, input: &str) -> Result<String>
Execute the flow - first matching branch wins
Sourcepub fn branch_count(&self) -> usize
pub fn branch_count(&self) -> usize
Get branch count
Auto Trait Implementations§
impl<C> Freeze for ConditionalFlow<C>
impl<C> !RefUnwindSafe for ConditionalFlow<C>
impl<C> Send for ConditionalFlow<C>
impl<C> Sync for ConditionalFlow<C>
impl<C> Unpin for ConditionalFlow<C>
impl<C> UnsafeUnpin for ConditionalFlow<C>
impl<C> !UnwindSafe for ConditionalFlow<C>
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