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: TypeInfoDirectoryspace_info_directory: SpaceInfoDirectoryprimitive_directory: PrimitiveDirectory

Implementations

impl Context[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]

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]

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]

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]

Given the argument and result types for a function type, returns the TypeId of the corresponding function type, assuming that it exists.

pub fn get_type(&self, id: TypeId) -> Type[src]

Given a TypeId, yields the Type struct describing the type.

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]

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]

Returns the total number of types registered in the TypeInfoDirectory.

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]

Given the TypeId of a function type, yields the TypeId of the function’s argument type.

pub fn get_ret_type_id(&self, func_type_id: TypeId) -> TypeId[src]

Given the TypeId of a function type, yields the TypeId of the function’s return type.

pub fn is_vector_type(&self, id: TypeId) -> bool[src]

Given a TypeId, returns true if the underlying Type is a vector type, and false if it’s a function type instead.

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> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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

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

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V