File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,22 @@ into its underlying representation (`into`). Conversions prefixed `to_`, on the
96
96
other hand, typically stay at the same level of abstraction but do some work to
97
97
change one representation into another.
98
98
99
+ When a type wraps a single value to associate it with higher-level semantics,
100
+ access to the wrapped value should be provided by an ` into_inner() ` method. This
101
+ applies to wrappers that provide buffering like [ ` BufReader ` ] , encoding or
102
+ decoding like [ ` GzDecoder ` ] , atomic access like [ ` AtomicBool ` ] , or any similar
103
+ semantics.
104
+
105
+ [ `BufReader` ] : https://doc.rust-lang.org/std/io/struct.BufReader.html#method.into_inner
106
+ [ `GzDecoder` ] : https://docs.rs/flate2/0.2.19/flate2/read/struct.GzDecoder.html#method.into_inner
107
+ [ `AtomicBool` ] : https://doc.rust-lang.org/std/sync/atomic/struct.AtomicBool.html#method.into_inner
108
+
99
109
##### More examples from the standard library
100
110
101
111
- [ ` Result::as_ref ` ] ( https://doc.rust-lang.org/std/result/enum.Result.html#method.as_ref )
102
112
- [ ` RefCell::as_ptr ` ] ( https://doc.rust-lang.org/std/cell/struct.RefCell.html#method.as_ptr )
103
113
- [ ` slice::to_vec ` ] ( https://doc.rust-lang.org/std/primitive.slice.html#method.to_vec )
104
114
- [ ` Option::into_iter ` ] ( https://doc.rust-lang.org/std/option/enum.Option.html#method.into_iter )
105
- - [ ` AtomicBool::into_inner ` ] ( https://doc.rust-lang.org/std/sync/atomic/struct.AtomicBool.html#method.into_inner )
106
115
107
116
108
117
<a id =" c-iter " ></a >
You can’t perform that action at this time.
0 commit comments