pub enum ReflectRef<'a> {
Struct(&'a (dyn Struct + 'static)),
TupleStruct(&'a (dyn TupleStruct + 'static)),
Tuple(&'a (dyn Tuple + 'static)),
List(&'a (dyn List + 'static)),
Array(&'a (dyn Array + 'static)),
Map(&'a (dyn Map + 'static)),
Set(&'a (dyn Set + 'static)),
Enum(&'a (dyn Enum + 'static)),
Function(&'a (dyn Function + 'static)),
Opaque(&'a (dyn PartialReflect + 'static)),
}Expand description
An immutable enumeration of “kinds” of a reflected type.
Each variant contains a trait object with methods specific to a kind of type.
A ReflectRef is obtained via PartialReflect::reflect_ref.
Variants§
Struct(&'a (dyn Struct + 'static))
TupleStruct(&'a (dyn TupleStruct + 'static))
Tuple(&'a (dyn Tuple + 'static))
List(&'a (dyn List + 'static))
Array(&'a (dyn Array + 'static))
Map(&'a (dyn Map + 'static))
Set(&'a (dyn Set + 'static))
Enum(&'a (dyn Enum + 'static))
Function(&'a (dyn Function + 'static))
functions only.Opaque(&'a (dyn PartialReflect + 'static))
Implementations§
Source§impl ReflectRef<'_>
impl ReflectRef<'_>
Sourcepub fn kind(&self) -> ReflectKind
pub fn kind(&self) -> ReflectKind
Returns the “kind” of this reflected type without any information.
Source§impl<'a> ReflectRef<'a>
impl<'a> ReflectRef<'a>
Sourcepub fn as_struct(
self,
) -> Result<&'a (dyn Struct + 'static), ReflectKindMismatchError>
pub fn as_struct( self, ) -> Result<&'a (dyn Struct + 'static), ReflectKindMismatchError>
Attempts a cast to a Struct trait object.
Returns an error if self is not the Self::Struct variant.
Examples found in repository?
12fn main() {
13 #[derive(Reflect, Default)]
14 #[reflect(Identifiable, Default)]
15 struct Player {
16 id: u32,
17 }
18
19 #[reflect_trait]
20 trait Identifiable {
21 fn id(&self) -> u32;
22 }
23
24 impl Identifiable for Player {
25 fn id(&self) -> u32 {
26 self.id
27 }
28 }
29
30 // Normally, when instantiating a type, you get back exactly that type.
31 // This is because the type is known at compile time.
32 // We call this the "concrete" or "canonical" type.
33 let player: Player = Player { id: 123 };
34
35 // When working with reflected types, however, we often "erase" this type information
36 // using the `Reflect` trait object.
37 // This trait object also gives us access to all the methods in the `PartialReflect` trait too.
38 // The underlying type is still the same (in this case, `Player`),
39 // but now we've hidden that information from the compiler.
40 let reflected: Box<dyn Reflect> = Box::new(player);
41
42 // Because it's the same type under the hood, we can still downcast it back to the original type.
43 assert!(reflected.downcast_ref::<Player>().is_some());
44
45 // But now let's "clone" our type using `PartialReflect::clone_value`.
46 // Notice here we bind it as a `dyn PartialReflect`.
47 let cloned: Box<dyn PartialReflect> = reflected.clone_value();
48
49 // If we try and convert it to a `dyn Reflect` trait object, we'll get an error.
50 assert!(cloned.try_as_reflect().is_none());
51
52 // Why is this?
53 // Well the reason is that `PartialReflect::clone_value` actually creates a dynamic type.
54 // Since `Player` is a struct, our trait object is actually a value of `DynamicStruct`.
55 assert!(cloned.is_dynamic());
56
57 // This dynamic type is used to represent (or "proxy") the original type,
58 // so that we can continue to access its fields and overall structure.
59 let cloned_ref = cloned.reflect_ref().as_struct().unwrap();
60 let id = cloned_ref.field("id").unwrap().try_downcast_ref::<u32>();
61 assert_eq!(id, Some(&123));
62
63 // It also enables us to create a representation of a type without having compile-time
64 // access to the actual type. This is how the reflection deserializers work.
65 // They generally can't know how to construct a type ahead of time,
66 // so they instead build and return these dynamic representations.
67 let input = "(id: 123)";
68 let mut registry = TypeRegistry::default();
69 registry.register::<Player>();
70 let registration = registry.get(std::any::TypeId::of::<Player>()).unwrap();
71 let deserialized = TypedReflectDeserializer::new(registration, ®istry)
72 .deserialize(&mut ron::Deserializer::from_str(input).unwrap())
73 .unwrap();
74
75 // Our deserialized output is a `DynamicStruct` that proxies/represents a `Player`.
76 assert!(deserialized.represents::<Player>());
77
78 // And while this does allow us to access the fields and structure of the type,
79 // there may be instances where we need the actual type.
80 // For example, if we want to convert our `dyn Reflect` into a `dyn Identifiable`,
81 // we can't use the `DynamicStruct` proxy.
82 let reflect_identifiable = registration
83 .data::<ReflectIdentifiable>()
84 .expect("`ReflectIdentifiable` should be registered");
85
86 // Trying to access the registry with our `deserialized` will give a compile error
87 // since it doesn't implement `Reflect`, only `PartialReflect`.
88 // Similarly, trying to force the operation will fail.
89 // This fails since the underlying type of `deserialized` is `DynamicStruct` and not `Player`.
90 assert!(deserialized
91 .try_as_reflect()
92 .and_then(|reflect_trait_obj| reflect_identifiable.get(reflect_trait_obj))
93 .is_none());
94
95 // So how can we go from a dynamic type to a concrete type?
96 // There are two ways:
97
98 // 1. Using `PartialReflect::apply`.
99 {
100 // If you know the type at compile time, you can construct a new value and apply the dynamic
101 // value to it.
102 let mut value = Player::default();
103 value.apply(deserialized.as_ref());
104 assert_eq!(value.id, 123);
105
106 // If you don't know the type at compile time, you need a dynamic way of constructing
107 // an instance of the type. One such way is to use the `ReflectDefault` type data.
108 let reflect_default = registration
109 .data::<ReflectDefault>()
110 .expect("`ReflectDefault` should be registered");
111
112 let mut value: Box<dyn Reflect> = reflect_default.default();
113 value.apply(deserialized.as_ref());
114
115 let identifiable: &dyn Identifiable = reflect_identifiable.get(value.as_reflect()).unwrap();
116 assert_eq!(identifiable.id(), 123);
117 }
118
119 // 2. Using `FromReflect`
120 {
121 // If you know the type at compile time, you can use the `FromReflect` trait to convert the
122 // dynamic value into the concrete type directly.
123 let value: Player = Player::from_reflect(deserialized.as_ref()).unwrap();
124 assert_eq!(value.id, 123);
125
126 // If you don't know the type at compile time, you can use the `ReflectFromReflect` type data
127 // to perform the conversion dynamically.
128 let reflect_from_reflect = registration
129 .data::<ReflectFromReflect>()
130 .expect("`ReflectFromReflect` should be registered");
131
132 let value: Box<dyn Reflect> = reflect_from_reflect
133 .from_reflect(deserialized.as_ref())
134 .unwrap();
135 let identifiable: &dyn Identifiable = reflect_identifiable.get(value.as_reflect()).unwrap();
136 assert_eq!(identifiable.id(), 123);
137 }
138
139 // Lastly, while dynamic types are commonly generated via reflection methods like
140 // `PartialReflect::clone_value` or via the reflection deserializers,
141 // you can also construct them manually.
142 let mut my_dynamic_list = DynamicList::from_iter([1u32, 2u32, 3u32]);
143
144 // This is useful when you just need to apply some subset of changes to a type.
145 let mut my_list: Vec<u32> = Vec::new();
146 my_list.apply(&my_dynamic_list);
147 assert_eq!(my_list, vec![1, 2, 3]);
148
149 // And if you want it to actually proxy a type, you can configure it to do that as well:
150 assert!(!my_dynamic_list
151 .as_partial_reflect()
152 .represents::<Vec<u32>>());
153 my_dynamic_list.set_represented_type(Some(<Vec<u32>>::type_info()));
154 assert!(my_dynamic_list
155 .as_partial_reflect()
156 .represents::<Vec<u32>>());
157
158 // ============================= REFERENCE ============================= //
159 // For reference, here are all the available dynamic types:
160
161 // 1. `DynamicTuple`
162 {
163 let mut dynamic_tuple = DynamicTuple::default();
164 dynamic_tuple.insert(1u32);
165 dynamic_tuple.insert(2u32);
166 dynamic_tuple.insert(3u32);
167
168 let mut my_tuple: (u32, u32, u32) = (0, 0, 0);
169 my_tuple.apply(&dynamic_tuple);
170 assert_eq!(my_tuple, (1, 2, 3));
171 }
172
173 // 2. `DynamicArray`
174 {
175 let dynamic_array = DynamicArray::from_iter([1u32, 2u32, 3u32]);
176
177 let mut my_array = [0u32; 3];
178 my_array.apply(&dynamic_array);
179 assert_eq!(my_array, [1, 2, 3]);
180 }
181
182 // 3. `DynamicList`
183 {
184 let dynamic_list = DynamicList::from_iter([1u32, 2u32, 3u32]);
185
186 let mut my_list: Vec<u32> = Vec::new();
187 my_list.apply(&dynamic_list);
188 assert_eq!(my_list, vec![1, 2, 3]);
189 }
190
191 // 4. `DynamicSet`
192 {
193 let mut dynamic_set = DynamicSet::from_iter(["x", "y", "z"]);
194 assert!(dynamic_set.contains(&"x"));
195
196 dynamic_set.remove(&"y");
197
198 let mut my_set: HashSet<&str> = HashSet::new();
199 my_set.apply(&dynamic_set);
200 assert_eq!(my_set, HashSet::from_iter(["x", "z"]));
201 }
202
203 // 5. `DynamicMap`
204 {
205 let dynamic_map = DynamicMap::from_iter([("x", 1u32), ("y", 2u32), ("z", 3u32)]);
206
207 let mut my_map: HashMap<&str, u32> = HashMap::new();
208 my_map.apply(&dynamic_map);
209 assert_eq!(my_map.get("x"), Some(&1));
210 assert_eq!(my_map.get("y"), Some(&2));
211 assert_eq!(my_map.get("z"), Some(&3));
212 }
213
214 // 6. `DynamicStruct`
215 {
216 #[derive(Reflect, Default, Debug, PartialEq)]
217 struct MyStruct {
218 x: u32,
219 y: u32,
220 z: u32,
221 }
222
223 let mut dynamic_struct = DynamicStruct::default();
224 dynamic_struct.insert("x", 1u32);
225 dynamic_struct.insert("y", 2u32);
226 dynamic_struct.insert("z", 3u32);
227
228 let mut my_struct = MyStruct::default();
229 my_struct.apply(&dynamic_struct);
230 assert_eq!(my_struct, MyStruct { x: 1, y: 2, z: 3 });
231 }
232
233 // 7. `DynamicTupleStruct`
234 {
235 #[derive(Reflect, Default, Debug, PartialEq)]
236 struct MyTupleStruct(u32, u32, u32);
237
238 let mut dynamic_tuple_struct = DynamicTupleStruct::default();
239 dynamic_tuple_struct.insert(1u32);
240 dynamic_tuple_struct.insert(2u32);
241 dynamic_tuple_struct.insert(3u32);
242
243 let mut my_tuple_struct = MyTupleStruct::default();
244 my_tuple_struct.apply(&dynamic_tuple_struct);
245 assert_eq!(my_tuple_struct, MyTupleStruct(1, 2, 3));
246 }
247
248 // 8. `DynamicEnum`
249 {
250 #[derive(Reflect, Default, Debug, PartialEq)]
251 enum MyEnum {
252 #[default]
253 Empty,
254 Xyz(u32, u32, u32),
255 }
256
257 let mut values = DynamicTuple::default();
258 values.insert(1u32);
259 values.insert(2u32);
260 values.insert(3u32);
261
262 let dynamic_variant = DynamicVariant::Tuple(values);
263 let dynamic_enum = DynamicEnum::new("Xyz", dynamic_variant);
264
265 let mut my_enum = MyEnum::default();
266 my_enum.apply(&dynamic_enum);
267 assert_eq!(my_enum, MyEnum::Xyz(1, 2, 3));
268 }
269}Sourcepub fn as_tuple_struct(
self,
) -> Result<&'a (dyn TupleStruct + 'static), ReflectKindMismatchError>
pub fn as_tuple_struct( self, ) -> Result<&'a (dyn TupleStruct + 'static), ReflectKindMismatchError>
Attempts a cast to a TupleStruct trait object.
Returns an error if self is not the Self::TupleStruct variant.
Sourcepub fn as_tuple(
self,
) -> Result<&'a (dyn Tuple + 'static), ReflectKindMismatchError>
pub fn as_tuple( self, ) -> Result<&'a (dyn Tuple + 'static), ReflectKindMismatchError>
Attempts a cast to a Tuple trait object.
Returns an error if self is not the Self::Tuple variant.
Sourcepub fn as_list(
self,
) -> Result<&'a (dyn List + 'static), ReflectKindMismatchError>
pub fn as_list( self, ) -> Result<&'a (dyn List + 'static), ReflectKindMismatchError>
Attempts a cast to a List trait object.
Returns an error if self is not the Self::List variant.
Sourcepub fn as_array(
self,
) -> Result<&'a (dyn Array + 'static), ReflectKindMismatchError>
pub fn as_array( self, ) -> Result<&'a (dyn Array + 'static), ReflectKindMismatchError>
Attempts a cast to a Array trait object.
Returns an error if self is not the Self::Array variant.
Sourcepub fn as_map(self) -> Result<&'a (dyn Map + 'static), ReflectKindMismatchError>
pub fn as_map(self) -> Result<&'a (dyn Map + 'static), ReflectKindMismatchError>
Sourcepub fn as_set(self) -> Result<&'a (dyn Set + 'static), ReflectKindMismatchError>
pub fn as_set(self) -> Result<&'a (dyn Set + 'static), ReflectKindMismatchError>
Sourcepub fn as_enum(
self,
) -> Result<&'a (dyn Enum + 'static), ReflectKindMismatchError>
pub fn as_enum( self, ) -> Result<&'a (dyn Enum + 'static), ReflectKindMismatchError>
Attempts a cast to a Enum trait object.
Returns an error if self is not the Self::Enum variant.
Sourcepub fn as_opaque(
self,
) -> Result<&'a (dyn PartialReflect + 'static), ReflectKindMismatchError>
pub fn as_opaque( self, ) -> Result<&'a (dyn PartialReflect + 'static), ReflectKindMismatchError>
Attempts a cast to a PartialReflect trait object.
Returns an error if self is not the Self::Opaque variant.
Trait Implementations§
Source§impl From<ReflectRef<'_>> for ReflectKind
impl From<ReflectRef<'_>> for ReflectKind
Source§fn from(value: ReflectRef<'_>) -> ReflectKind
fn from(value: ReflectRef<'_>) -> ReflectKind
Auto Trait Implementations§
impl<'a> Freeze for ReflectRef<'a>
impl<'a> !RefUnwindSafe for ReflectRef<'a>
impl<'a> Send for ReflectRef<'a>
impl<'a> Sync for ReflectRef<'a>
impl<'a> Unpin for ReflectRef<'a>
impl<'a> !UnwindSafe for ReflectRef<'a>
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.