pub trait TyExt: Sized {
// Required method
fn defid_ref(&self) -> Option<&DefId>;
// Provided method
fn defid(self) -> Option<DefId> { ... }
}
Expand description
Required Methods§
Provided Methods§
Sourcefn defid(self) -> Option<DefId>
fn defid(self) -> Option<DefId>
Extract a DefId
if this type references an object that has one. This
is true for most user defined types, including types form the standard
library, but not builtin types, such as u32
, arrays or ad-hoc types
such as function pointers.
Use with caution, this function might not be exhaustive (yet).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.