pub struct Scheme<'a> {
pub builtins: FxHashMap<&'a str, BuiltinConstructor<'a>>,
pub types: FxHashMap<&'a str, Constructor<'a>>,
pub boxed_types: FxHashMap<&'a str, Vec<&'a str>>,
pub functions: FxHashMap<&'a str, Constructor<'a>>,
}Expand description
Parsed scheme with all types and functions.
Fields
builtins: FxHashMap<&'a str, BuiltinConstructor<'a>>types: FxHashMap<&'a str, Constructor<'a>>boxed_types: FxHashMap<&'a str, Vec<&'a str>>functions: FxHashMap<&'a str, Constructor<'a>>Implementations
sourceimpl<'a> Scheme<'a>
impl<'a> Scheme<'a>
sourcepub fn compute_all_ids(
&self
) -> FxHashMap<u32, (ConstructorKind, &Constructor<'a>)>
pub fn compute_all_ids(
&self
) -> FxHashMap<u32, (ConstructorKind, &Constructor<'a>)>
Computes all TL ids in the scheme
sourcepub fn find_constructor(
&self,
name: &str
) -> Option<(ConstructorKind, &Constructor<'a>)>
pub fn find_constructor(
&self,
name: &str
) -> Option<(ConstructorKind, &Constructor<'a>)>
Finds a type variant or function with the given name
sourcepub fn get_type_variant(&self, name: &str) -> Option<&Constructor<'a>>
pub fn get_type_variant(&self, name: &str) -> Option<&Constructor<'a>>
Finds type variant with the given name
sourcepub fn get_function(&self, name: &str) -> Option<&Constructor<'a>>
pub fn get_function(&self, name: &str) -> Option<&Constructor<'a>>
Finds function with the given name
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Scheme<'a>
impl<'a> Send for Scheme<'a>
impl<'a> Sync for Scheme<'a>
impl<'a> Unpin for Scheme<'a>
impl<'a> UnwindSafe for Scheme<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more