Skip to main content
A trait for dereferencing a value to provide transparent access to its contents. Implementing this trait allows a type to behave like its inner type, enabling direct access to the inner type’s fields. Note: The Deref mechanism is limited and cannot be used to implicitly convert a type to its target type when passing arguments to functions. For example, if you have a function that takes an Inner, you cannot pass an Outer to it even if Outer implements Deref.

Signature

Examples

Trait functions

deref

Returns the dereferenced value.

Signature

Trait types

Target

The type of the dereferenced value.

Signature