Skip to content
masterclass Buddy

Rust · Trait

Deref

Deref lets a type provide an immutable reference to a target value. Rust uses it for * and may apply it automatically through deref coercion.

Last updated

Since
1.0.0

Syntax

pub trait Deref {
    type Target: ?Sized;
    fn deref(&self) -> &Self::Target;
}

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • DerefMut
  • AsRef
  • Borrow

Source: Deref in std::ops - Rust. Checked 2026-11-03.