[−][src]Struct kul::parser::HashMapOperatorBindings
An OperatorBindings
that associates generic Datum
s with generic
Combiner
s, using a HashMap
.
The Datum
keys 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 populating the hashmap
field with the desired
bindings, and it may be dynamically mutated inbetween parser invocations, if
desired.
Fields
hashmap: HashMap<Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>, S>
The HashMap
of operators bound to macros. You must populate and
manage this yourself.
Methods
impl<DA, OR, AR, CE, S> HashMapOperatorBindings<DA, OR, AR, CE, S> where
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher,
[src]
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher,
pub fn new(
hashmap: HashMap<Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>, S>
) -> Self
[src]
hashmap: HashMap<Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>, S>
) -> Self
Given a HashMap
of our type, make a new instance of Self
that uses
it for its hashmap
field.
This enables using a premade HashMap
, possibly with a certain capacity
and/or with a different hashing algorithm (as supported by HashMap
).
Trait Implementations
impl<DA, OR, AR, CE, S> Default for HashMapOperatorBindings<DA, OR, AR, CE, S> where
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher + Default,
[src]
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher + Default,
impl<DA: Debug, OR: Debug, AR: Debug, CE: Debug, S: Debug> Debug for HashMapOperatorBindings<DA, OR, AR, CE, S> where
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher,
DA::TT: Debug,
DA::ET: Debug,
DA::DR: Debug,
[src]
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher,
DA::TT: Debug,
DA::ET: Debug,
DA::DR: Debug,
impl<DA, OR, AR, CE, S> OperatorBindings<DA> for HashMapOperatorBindings<DA, OR, AR, CE, S> where
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher,
OR: Deref<Target = OpFn<DA, CE>>,
AR: Deref<Target = ApFn<DA, CE>>,
[src]
DA: DatumAllocator,
DA::TT: Hash + Eq,
DA::ET: Hash + Eq,
DA::DR: Hash + Eq,
S: BuildHasher,
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>>
Auto Trait Implementations
impl<DA, OR, AR, CE, S = RandomState> !Send for HashMapOperatorBindings<DA, OR, AR, CE, S>
impl<DA, OR, AR, CE, S = RandomState> !Sync for HashMapOperatorBindings<DA, OR, AR, CE, S>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
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> 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, 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,