pub struct Conditions { /* private fields */ }Expand description
Router conditions by name, as written in condition = "name(args)".
new starts with the built-in flag(key), which returns "true" or
"false" for a bool state key.
Implementations§
Source§impl Conditions
impl Conditions
Sourcepub fn new() -> Self
pub fn new() -> Self
Builds the set holding only the built-in flag.
Register more with register.
Returns the set.
Sourcepub fn register(&mut self, name: &str, f: ConditionFn) -> Result<(), GraphError>
pub fn register(&mut self, name: &str, f: ConditionFn) -> Result<(), GraphError>
Adds condition f under name, which must match
[a-z_][a-z0-9_]* and not be taken yet.
Returns Setup otherwise.
Sourcepub fn get(&self, name: &str) -> Option<&ConditionFn>
pub fn get(&self, name: &str) -> Option<&ConditionFn>
Returns the condition registered under name.
None when there is none.
Graph runs check every router’s condition at setup.
Trait Implementations§
Source§impl Clone for Conditions
impl Clone for Conditions
Auto Trait Implementations§
impl !RefUnwindSafe for Conditions
impl !UnwindSafe for Conditions
impl Forget for Conditions
impl Freeze for Conditions
impl Move for Conditions
impl Send for Conditions
impl Sync for Conditions
impl Unpin for Conditions
impl UnsafeUnpin for Conditions
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