RuleBuilder

Struct RuleBuilder 

Source
pub struct RuleBuilder<Q, S> { /* private fields */ }

Implementations§

Source§

impl<Q, S> RuleBuilder<Q, S>
where Q: RawState,

Source

pub const fn new() -> Self

initialize a new instance of the RuleBuilder

Source

pub fn direction(self, direction: Direction) -> Self

configure the direction

Source

pub fn left(self) -> Self

toggle the direction to the Left

Source

pub fn right(self) -> Self

toggle the direction to the Right

Source

pub fn stay(self) -> Self

toggle the direction to the Stay

Source

pub fn state(self, state: State<Q>) -> Self

configure the current state

Source

pub fn symbol(self, symbol: S) -> Self

configure the current symbol

Source

pub fn next_state(self, State: State<Q>) -> Self

configure the next state

Source

pub fn write_symbol(self, write_symbol: S) -> Self

configure the symbol to write

Source

pub fn build(self) -> Rule<Q, S>

consume the current instance to create a formal Rule

Trait Implementations§

Source§

impl<Q: Default, S: Default> Default for RuleBuilder<Q, S>

Source§

fn default() -> RuleBuilder<Q, S>

Returns the “default value” for a type. Read more
Source§

impl<Q, S> From<RuleBuilder<Q, S>> for Rule<Q, S>
where Q: RawState,

Source§

fn from(builder: RuleBuilder<Q, S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<Q, S> Freeze for RuleBuilder<Q, S>
where S: Freeze, Q: Freeze,

§

impl<Q, S> RefUnwindSafe for RuleBuilder<Q, S>

§

impl<Q, S> Send for RuleBuilder<Q, S>
where S: Send, Q: Send,

§

impl<Q, S> Sync for RuleBuilder<Q, S>
where S: Sync, Q: Sync,

§

impl<Q, S> Unpin for RuleBuilder<Q, S>
where S: Unpin, Q: Unpin,

§

impl<Q, S> UnwindSafe for RuleBuilder<Q, S>
where S: UnwindSafe, Q: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.