pub trait Named: Sized + 'static {
// Required method
fn typename() -> &'static str;
// Provided methods
fn typehash() -> u64 { ... }
fn typeid() -> TypeId { ... }
fn port() -> u64 { ... }
fn arm(&self) -> Option<&'static str> { ... }
unsafe fn arm_unchecked(self_: *const ()) -> Option<&'static str> { ... }
}
Expand description
A Named
type is a type that has a globally unique name.
Required Methods§
Provided Methods§
Sourcefn typehash() -> u64
fn typehash() -> u64
A globally unique hash for this type. TODO: actually enforce perfect hashing
Sourcefn typeid() -> TypeId
fn typeid() -> TypeId
The TypeId for this type. TypeIds are unique only within a binary, and should not be used for global identification.
Sourcefn port() -> u64
fn port() -> u64
The globally unique port for this type. Typed ports are in the range of 1<<63..1<<64-1.
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.