TypesSemantic

Trait TypesSemantic 

Source
pub trait TypesSemantic<'db>: Database {
    // Provided methods
    fn generic_type_generic_params(
        &'db self,
        generic_type: GenericTypeId<'db>,
    ) -> Maybe<&'db [GenericParam<'db>]> { ... }
    fn single_value_type(&'db self, ty: TypeId<'db>) -> Maybe<bool> { ... }
    fn type_size_info(&'db self, ty: TypeId<'db>) -> Maybe<TypeSizeInformation> { ... }
    fn type_info(
        &'db self,
        lookup_context: ImplLookupContextId<'db>,
        ty: TypeId<'db>,
    ) -> TypeInfo<'db> { ... }
    fn copyable(
        &'db self,
        ty: TypeId<'db>,
    ) -> Result<ImplId<'db>, InferenceError<'db>> { ... }
    fn droppable(
        &'db self,
        ty: TypeId<'db>,
    ) -> Result<ImplId<'db>, InferenceError<'db>> { ... }
}
Expand description

Trait for types-related semantic queries.

Provided Methods§

Source

fn generic_type_generic_params( &'db self, generic_type: GenericTypeId<'db>, ) -> Maybe<&'db [GenericParam<'db>]>

Returns the generic params of a generic type.

Source

fn single_value_type(&'db self, ty: TypeId<'db>) -> Maybe<bool>

Returns true if there is only one value for the given type and hence the values of the given type are all interchangeable. Examples include the unit type tuple of a unit type and empty structs. Always returns false for extern types.

Source

fn type_size_info(&'db self, ty: TypeId<'db>) -> Maybe<TypeSizeInformation>

Returns the type size information for the given type.

Source

fn type_info( &'db self, lookup_context: ImplLookupContextId<'db>, ty: TypeId<'db>, ) -> TypeInfo<'db>

Returns the type info for a type in a context.

Source

fn copyable( &'db self, ty: TypeId<'db>, ) -> Result<ImplId<'db>, InferenceError<'db>>

Returns the Copy impl for a type in general context.

Source

fn droppable( &'db self, ty: TypeId<'db>, ) -> Result<ImplId<'db>, InferenceError<'db>>

Returns the Drop impl for a type in general context.

Implementors§

Source§

impl<'db, T: Database + ?Sized> TypesSemantic<'db> for T