File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3622,6 +3622,14 @@ The `Sized` trait indicates that the size of this type is known at compile-time.
3622
3622
The ` Drop ` trait provides a destructor, to be run whenever a value of this type
3623
3623
is to be destroyed.
3624
3624
3625
+ ## The ` Deref ` trait
3626
+
3627
+ The ` Deref<Target = U> ` trait allows a type to implicitly implement all the methods
3628
+ of the type ` U ` . When attempting to resolve a method call, the compiler will search
3629
+ the top-level type for the implementation of the called method. If no such method is
3630
+ found, ` .deref() ` is called and the compiler continues to search for the method
3631
+ implementation in the returned type ` U ` .
3632
+
3625
3633
# Memory model
3626
3634
3627
3635
A Rust program's memory consists of a static set of * items* and a * heap* .
You can’t perform that action at this time.
0 commit comments