Skip to main content

Identity

Trait Identity 

Source
#[doc(hidden)]
pub trait Identity { type Type: ?Sized; }
Expand description

Projects Self to itself.

This is used by macros to have the compiler verify that two syntactically similar types actually resolve to the same type. The blanket implementation ensures that no other implementation can project a type to anything other than itself.

Required Associated Types§

Source

type Type: ?Sized

Self.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: ?Sized> Identity for T

Source§

type Type = T