Skip to main content

Mapped

Struct Mapped 

Source
pub struct Mapped<A, F> {
    pub inner: A,
    pub map: F,
}
Expand description

Symbol-renaming view of an automaton.

Mapped is useful when an automaton should be queried under a different external signature. The mapping is applied to every input symbol before the wrapped automaton is queried. States are unchanged.

Fields§

§inner: A

Wrapped automaton.

§map: F

Function from external symbol IDs to the wrapped automaton’s symbol IDs.

Implementations§

Source§

impl<A, F> Mapped<A, F>

Source

pub fn new(inner: A, map: F) -> Self

Create a mapped view.

Trait Implementations§

Source§

impl<A, F> BottomUpTa for Mapped<A, F>
where A: BottomUpTa, F: Fn(Symbol) -> Symbol,

Source§

type State = <A as BottomUpTa>::State

State type carried by the automaton. Read more
Source§

fn step( &self, f: Symbol, children: &[Self::State], out: &mut dyn FnMut(Self::State), )

Report all possible parent states for f(children...). Read more
Source§

fn is_accepting(&self, q: &Self::State) -> bool

Return whether q is an accepting state. Read more
Source§

impl<A: Clone, F: Clone> Clone for Mapped<A, F>

Source§

fn clone(&self) -> Mapped<A, F>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Copy, F: Copy> Copy for Mapped<A, F>

Source§

impl<A: Debug, F: Debug> Debug for Mapped<A, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A, F> DetBottomUpTa for Mapped<A, F>
where A: DetBottomUpTa, F: Fn(Symbol) -> Symbol,

Source§

fn step_det(&self, f: Symbol, children: &[Self::State]) -> Option<Self::State>

Return the unique result state, or None if no transition exists. Read more
Source§

fn det_group(&self, f: Symbol) -> u32

Group key for symbols that share a transition function. Read more
Source§

impl<A: Eq, F: Eq> Eq for Mapped<A, F>

Source§

impl<A, F> IndexedBottomUpTa for Mapped<A, F>
where A: IndexedBottomUpTa, F: Fn(Symbol) -> Symbol,

Source§

fn step_partial( &self, f: Symbol, position: usize, state_at_position: &Self::State, out: &mut dyn FnMut(&[Self::State], Self::State), )

Report every rule f(children...) -> q where children[position] equals state_at_position. Read more
Source§

impl<A: PartialEq, F: PartialEq> PartialEq for Mapped<A, F>

Source§

fn eq(&self, other: &Mapped<A, F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A: PartialEq, F: PartialEq> StructuralPartialEq for Mapped<A, F>

Auto Trait Implementations§

§

impl<A, F> Freeze for Mapped<A, F>
where A: Freeze, F: Freeze,

§

impl<A, F> RefUnwindSafe for Mapped<A, F>

§

impl<A, F> Send for Mapped<A, F>
where A: Send, F: Send,

§

impl<A, F> Sync for Mapped<A, F>
where A: Sync, F: Sync,

§

impl<A, F> Unpin for Mapped<A, F>
where A: Unpin, F: Unpin,

§

impl<A, F> UnsafeUnpin for Mapped<A, F>
where A: UnsafeUnpin, F: UnsafeUnpin,

§

impl<A, F> UnwindSafe for Mapped<A, F>
where A: UnwindSafe, F: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.