[−][src]Struct kul_core::parser::premade::PairOperatorBindings
An OperatorBindings
that associates generic Datum
s with generic
Combiner
s, using a slice of pairs (2-tuples) of them.
The Datum
values represent parsed operator sub-forms (of non-empty nest
forms) that are bound to macro functions represented by the Combiner
values.
You are responsible for initializing the slice with the desired bindings, and it may be dynamically mutated inbetween parser invocations, if desired and if you use a mutable type for it.
Fields
pairs: P
The bindings of operators to macros. You must initialize and manage this yourself.
Methods
impl<P, DA, OR, AR, CE> PairOperatorBindings<P, DA, OR, AR, CE> where
P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
[src]
P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
pub fn new(pairs: P) -> Self
[src]
Given a value of a type that can borrow as a slice of pairs (2-tuples)
of Datum
s with Combiner
s, make a new instance of Self
that uses it
for its bindings.
Trait Implementations
impl<P, DA, OR, AR, CE> OperatorBindings<DA> for PairOperatorBindings<P, DA, OR, AR, CE> where
P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
Datum<DA::TT, DA::ET, DA::DR>: PartialEq,
OR: Deref<Target = OpFn<DA, CE>>,
AR: Deref<Target = ApFn<DA, CE>>,
[src]
P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
Datum<DA::TT, DA::ET, DA::DR>: PartialEq,
OR: Deref<Target = OpFn<DA, CE>>,
AR: Deref<Target = ApFn<DA, CE>>,
type OR = OR
The type of references to Operative
macro functions. Read more
type AR = AR
The type of references to Applicative
macro functions. Read more
type CE = CE
The combiner error extension type. Read more
fn lookup(
&self,
operator: &Datum<DA::TT, DA::ET, DA::DR>
) -> Option<&Combiner<OR, AR>>
[src]
&self,
operator: &Datum<DA::TT, DA::ET, DA::DR>
) -> Option<&Combiner<OR, AR>>
impl<P: Debug, DA: Debug, OR: Debug, AR: Debug, CE: Debug> Debug for PairOperatorBindings<P, DA, OR, AR, CE> where
P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
[src]
P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
impl<P, DA, OR, AR, CE> Default for PairOperatorBindings<P, DA, OR, AR, CE> where
P: Default + Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
[src]
P: Default + Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
DA: DatumAllocator,
Auto Trait Implementations
impl<P, DA, OR, AR, CE> !Send for PairOperatorBindings<P, DA, OR, AR, CE>
impl<P, DA, OR, AR, CE> !Sync for PairOperatorBindings<P, DA, OR, AR, CE>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,