#[repr(C)]pub struct Tail<Q, A> {
pub direction: Direction,
pub next_state: State<Q>,
pub write_symbol: A,
}Expand description
The Tail of a rule in a Turing machine
Fields§
§direction: Direction§next_state: State<Q>§write_symbol: AImplementations§
Source§impl<Q, A> Tail<Q, A>where
Q: RawState,
impl<Q, A> Tail<Q, A>where
Q: RawState,
pub const fn new(direction: Direction, next_state: Q, write_symbol: A) -> Self
Sourcepub fn from_head(direction: Direction, head: Head<Q, A>) -> Self
pub fn from_head(direction: Direction, head: Head<Q, A>) -> Self
returns a new instance of the Tail using the given direction and head
Sourcepub const fn as_tuple(&self) -> (Direction, &State<Q>, &A)
pub const fn as_tuple(&self) -> (Direction, &State<Q>, &A)
returns the direction, state, and symbol as a 3-tuple
Sourcepub fn into_tuple(self) -> (Direction, State<Q>, A)
pub fn into_tuple(self) -> (Direction, State<Q>, A)
consumes the tail and returns the direction, state, and symbol as a 3-tuple
Sourcepub const fn direction(&self) -> Direction
pub const fn direction(&self) -> Direction
returns the direction the head is instructed to move
Sourcepub const fn state(&self) -> &State<Q>
pub const fn state(&self) -> &State<Q>
returns the next state with an immutable reference to the inner value
Sourcepub const fn state_mut(&mut self) -> &mut State<Q>
pub const fn state_mut(&mut self) -> &mut State<Q>
returns the next state with a mutable reference to the inner value
Sourcepub const fn symbol_mut(&mut self) -> &mut A
pub const fn symbol_mut(&mut self) -> &mut A
returns a mutable reference to the symbol of the tail
Sourcepub fn set_direction(&mut self, direction: Direction)
pub fn set_direction(&mut self, direction: Direction)
update the direction of the tail
Sourcepub fn set_symbol(&mut self, symbol: A)
pub fn set_symbol(&mut self, symbol: A)
update the defined symbol for the tail
Sourcepub fn with_direction(self, direction: Direction) -> Self
pub fn with_direction(self, direction: Direction) -> Self
consumes the current instance to create another with the given Direction
Sourcepub fn with_state(self, state: Q) -> Self
pub fn with_state(self, state: Q) -> Self
consumes the current instance to create another with the given state
Sourcepub fn with_symbol(self, symbol: A) -> Self
pub fn with_symbol(self, symbol: A) -> Self
Configures the tail with a new symbol
Trait Implementations§
Source§impl<Q, S> BorrowMut<Tail<Q, S>> for Rule<Q, S>where
Q: RawState,
impl<Q, S> BorrowMut<Tail<Q, S>> for Rule<Q, S>where
Q: RawState,
Source§fn borrow_mut(&mut self) -> &mut Tail<Q, S>
fn borrow_mut(&mut self) -> &mut Tail<Q, S>
Mutably borrows from an owned value. Read more
Source§impl<'de, Q, A> Deserialize<'de> for Tail<Q, A>where
Q: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, Q, A> Deserialize<'de> for Tail<Q, A>where
Q: Deserialize<'de>,
A: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Q: Ord, A: Ord> Ord for Tail<Q, A>
impl<Q: Ord, A: Ord> Ord for Tail<Q, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Q: PartialOrd, A: PartialOrd> PartialOrd for Tail<Q, A>
impl<Q: PartialOrd, A: PartialOrd> PartialOrd for Tail<Q, A>
impl<Q: Copy, A: Copy> Copy for Tail<Q, A>
impl<Q: Eq, A: Eq> Eq for Tail<Q, A>
impl<Q, A> StructuralPartialEq for Tail<Q, A>
Auto Trait Implementations§
impl<Q, A> Freeze for Tail<Q, A>
impl<Q, A> RefUnwindSafe for Tail<Q, A>where
A: RefUnwindSafe,
Q: RefUnwindSafe,
impl<Q, A> Send for Tail<Q, A>
impl<Q, A> Sync for Tail<Q, A>
impl<Q, A> Unpin for Tail<Q, A>
impl<Q, A> UnwindSafe for Tail<Q, A>where
A: UnwindSafe,
Q: UnwindSafe,
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