Struct fetish_lib::context::Context [−][src]
pub struct Context { pub type_info_directory: TypeInfoDirectory, pub space_info_directory: SpaceInfoDirectory, pub primitive_directory: PrimitiveDirectory, }
Expand description
Stores interpreter-global context information, such as the
collection of all types in the language, the collection of all
primitives, and the definitions of their associated featurization
maps. See TypeInfoDirectory
, SpaceInfoDirectory
, PrimitiveDirectory
for these individual components.
Fields
type_info_directory: TypeInfoDirectory
space_info_directory: SpaceInfoDirectory
primitive_directory: PrimitiveDirectory
Implementations
impl Context
[src]
impl Context
[src]pub fn get_primitive(
&self,
primitive_term_pointer: PrimitiveTermPointer
) -> &dyn FuncImpl
[src]
pub fn get_primitive(
&self,
primitive_term_pointer: PrimitiveTermPointer
) -> &dyn FuncImpl
[src]Given a PrimitiveTermPointer
, yields the FuncImpl
it references.
pub fn get_feature_space_info(&self, type_id: TypeId) -> &FeatureSpaceInfo
[src]
pub fn get_feature_space_info(&self, type_id: TypeId) -> &FeatureSpaceInfo
[src]Gets a reference to the FeatureSpaceInfo
for the given TypeId
.
pub fn build_function_space_info(
&self,
arg_type_id: TypeId,
ret_type_id: TypeId
) -> FunctionSpaceInfo<'_>
[src]
pub fn build_function_space_info(
&self,
arg_type_id: TypeId,
ret_type_id: TypeId
) -> FunctionSpaceInfo<'_>
[src]Gets the FunctionSpaceInfo
for functions going from the given arg_type_id
to the
given ret_type_id
.
pub fn get_function_space_info(
&self,
func_type_id: TypeId
) -> FunctionSpaceInfo<'_>
[src]
pub fn get_function_space_info(
&self,
func_type_id: TypeId
) -> FunctionSpaceInfo<'_>
[src]Gets the FunctionSpaceInfo
for the given function TypeId
.
pub fn get_func_type_id(
&self,
arg_type_id: TypeId,
ret_type_id: TypeId
) -> TypeId
[src]
pub fn get_func_type_id(
&self,
arg_type_id: TypeId,
ret_type_id: TypeId
) -> TypeId
[src]Given the argument and result types for a function type, returns the
TypeId
of the corresponding function type, assuming that it exists.
pub fn has_func_type(&self, arg_type_id: TypeId, ret_type_id: TypeId) -> bool
[src]
pub fn has_func_type(&self, arg_type_id: TypeId, ret_type_id: TypeId) -> bool
[src]Given the argument and result types for a function type, returns true iff
the function type actually exists in the TypeInfoDirectory
.
pub fn get_application_type_ids(&self, id: TypeId) -> Vec<(TypeId, TypeId)>
[src]
pub fn get_application_type_ids(&self, id: TypeId) -> Vec<(TypeId, TypeId)>
[src]Given a target type, yields the collection of all pairs (func_type_id, arg_type_id)
in the TypeInfoDirectory
for which the return type is the given target.
pub fn get_total_num_types(&self) -> usize
[src]
pub fn get_total_num_types(&self) -> usize
[src]Returns the total number of types registered in the TypeInfoDirectory
.
pub fn get_dimension(&self, vec_type_id: TypeId) -> usize
[src]
pub fn get_dimension(&self, vec_type_id: TypeId) -> usize
[src]Given the TypeId
of a vector type, yields the dimensionality of the
corresponding vector space.
pub fn get_arg_type_id(&self, func_type_id: TypeId) -> TypeId
[src]
pub fn get_arg_type_id(&self, func_type_id: TypeId) -> TypeId
[src]pub fn get_ret_type_id(&self, func_type_id: TypeId) -> TypeId
[src]
pub fn get_ret_type_id(&self, func_type_id: TypeId) -> TypeId
[src]Auto Trait Implementations
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,