pub struct Decider<A, D> {
pub description: &'static str,
pub decider: fn(&[&str], &mut SVec<A>) -> Decision<D>,
}Expand description
A decider is a function taking in a sequence of tokens and an output array
It puts tokens into the output array according to interal logic and returns how many elements
it has consumed. If it could not process the input tokens it will return a Deny, containing
the reason for denying.
Fields§
§description: &'static strThe description of the decider. Used in help and error messages.
decider: fn(&[&str], &mut SVec<A>) -> Decision<D>Decider function, takes a list of inputs and writes it to the list of outputs, returns a decision that informs the machinery how to continue, by either telling it to consume N items or to deny the input.
Auto Trait Implementations§
impl<A, D> Freeze for Decider<A, D>
impl<A, D> RefUnwindSafe for Decider<A, D>
impl<A, D> Send for Decider<A, D>
impl<A, D> Sync for Decider<A, D>
impl<A, D> Unpin for Decider<A, D>
impl<A, D> UnwindSafe for Decider<A, D>
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