Skip to main content

CrateDefType

Trait CrateDefType 

Source
pub trait CrateDefType: CrateDef {
    // Provided methods
    fn ty(&self) -> Ty { ... }
    fn ty_with_args(&self, args: &GenericArgs) -> Ty { ... }
}
Expand description

A trait that can be used to retrieve a definition’s type.

Note that not every CrateDef has a type Ty. They should not implement this trait.

Provided Methods§

Source

fn ty(&self) -> Ty

Returns the type of this crate item.

Source

fn ty_with_args(&self, args: &GenericArgs) -> Ty

Retrieve the type of this definition by instantiating and normalizing it with args.

This will panic if instantiation fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§