pub struct TypeInfoDirectory { /* private fields */ }Expand description
Implementations§
Source§impl TypeInfoDirectory
impl TypeInfoDirectory
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty TypeInfoDirectory.
Sourcepub fn add(&mut self, info: Type) -> TypeId
pub fn add(&mut self, info: Type) -> TypeId
Adds the given Type to this TypeInfoDirectory, and
returns the TypeId that it was assigned.
Sourcepub fn get_total_num_types(&self) -> usize
pub fn get_total_num_types(&self) -> usize
Gets the total number of types stored in this TypeInfoDirectory.
Since TypeIds are allocated consecutively, it’s correct to use
this as an iteration bound if you want to iterate over all TypeIds stored here.
Sourcepub fn has_func_type(&self, arg_type_id: TypeId, ret_type_id: TypeId) -> bool
pub fn has_func_type(&self, arg_type_id: TypeId, ret_type_id: TypeId) -> bool
Returns true iff this TypeInfoDirectory has a registered TypeId for
Type::FuncType(arg_type_id, ret_type_id).
Sourcepub fn get_func_type_id(
&self,
arg_type_id: TypeId,
ret_type_id: TypeId,
) -> TypeId
pub fn get_func_type_id( &self, arg_type_id: TypeId, ret_type_id: TypeId, ) -> TypeId
Sourcepub fn get_application_type_ids(&self, id: TypeId) -> Vec<(TypeId, TypeId)>
pub fn get_application_type_ids(&self, id: TypeId) -> Vec<(TypeId, TypeId)>
Gets all (func_type_id, arg_type_id) pairs which may be applied to yield the
given TypeId.
Sourcepub fn get_ret_type_id(&self, func_type_id: TypeId) -> TypeId
pub fn get_ret_type_id(&self, func_type_id: TypeId) -> TypeId
Sourcepub fn is_vector_type(&self, id: TypeId) -> bool
pub fn is_vector_type(&self, id: TypeId) -> bool
Returns true iff the given TypeId points to a Type::VecType.
Sourcepub fn get_arg_type_id(&self, func_type_id: TypeId) -> TypeId
pub fn get_arg_type_id(&self, func_type_id: TypeId) -> TypeId
Sourcepub fn get_dimension(&self, vec_type_id: TypeId) -> usize
pub fn get_dimension(&self, vec_type_id: TypeId) -> usize
Assuming that the given TypeId points to a Type::VecType, yields the
declared number of dimensions for that type’s base space.
Auto Trait Implementations§
impl Freeze for TypeInfoDirectory
impl RefUnwindSafe for TypeInfoDirectory
impl Send for TypeInfoDirectory
impl Sync for TypeInfoDirectory
impl Unpin for TypeInfoDirectory
impl UnwindSafe for TypeInfoDirectory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more