[][src]Struct kul::parser::HashMapOperatorBindings

pub struct HashMapOperatorBindings<DA, OR, AR, CE, S = RandomState> where
    DA: DatumAllocator,
    DA::TT: Hash + Eq,
    DA::ET: Hash + Eq,
    DA::DR: Hash + Eq,
    S: BuildHasher
{ pub hashmap: HashMap<Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>, S>, // some fields omitted }

An OperatorBindings that associates generic Datums with generic Combiners, 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]

pub fn new(
    hashmap: HashMap<Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>, S>
) -> Self
[src]

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]

fn default() -> Self[src]

Make a new instance of Self using the HashMap::default() of our type.

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]

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]

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

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]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]