pub struct CascadeShadowConfigBuilder {
pub num_cascades: usize,
pub minimum_distance: f32,
pub maximum_distance: f32,
pub first_cascade_far_bound: f32,
pub overlap_proportion: f32,
}Expand description
Builder for CascadeShadowConfig.
Fields§
§num_cascades: usizeThe number of shadow cascades. More cascades increases shadow quality by mitigating perspective aliasing - a phenomenon where areas nearer the camera are covered by fewer shadow map texels than areas further from the camera, causing blocky looking shadows.
This does come at the cost increased rendering overhead, however this overhead is still less than if you were to use fewer cascades and much larger shadow map textures to achieve the same quality level.
In case rendered geometry covers a relatively narrow and static depth relative to camera, it may
make more sense to use fewer cascades and a higher resolution shadow map texture as perspective aliasing
is not as much an issue. Be sure to adjust minimum_distance and maximum_distance appropriately.
minimum_distance: f32The minimum shadow distance, which can help improve the texel resolution of the first cascade. Areas nearer to the camera than this will likely receive no shadows.
NOTE: Due to implementation details, this usually does not impact shadow quality as much as
first_cascade_far_bound and maximum_distance. At many view frustum field-of-views, the
texel resolution of the first cascade is dominated by the width / height of the view frustum plane
at first_cascade_far_bound rather than the depth of the frustum from minimum_distance to
first_cascade_far_bound.
maximum_distance: f32The maximum shadow distance. Areas further from the camera than this will likely receive no shadows.
first_cascade_far_bound: f32Sets the far bound of the first cascade, relative to the view origin. In-between cascades will be exponentially spaced relative to the maximum shadow distance. NOTE: This is ignored if there is only one cascade, the maximum distance takes precedence.
overlap_proportion: f32Sets the overlap proportion between cascades. The overlap is used to make the transition from one cascade’s shadow map to the next less abrupt by blending between both shadow maps.
Implementations§
Source§impl CascadeShadowConfigBuilder
impl CascadeShadowConfigBuilder
Sourcepub fn build(&self) -> CascadeShadowConfig
pub fn build(&self) -> CascadeShadowConfig
Returns the cascade config as specified by this builder.
Examples found in repository?
98fn setup_camera_and_environment(
99 mut commands: Commands,
100 mut meshes: ResMut<Assets<Mesh>>,
101 mut materials: ResMut<Assets<StandardMaterial>>,
102) {
103 // Camera
104 commands.spawn((
105 Camera3d::default(),
106 Transform::from_xyz(100.0, 100.0, 150.0).looking_at(Vec3::new(0.0, 20.0, 0.0), Vec3::Y),
107 ));
108
109 // Plane
110 commands.spawn((
111 Mesh3d(meshes.add(Plane3d::default().mesh().size(500000.0, 500000.0))),
112 MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
113 ));
114
115 // Light
116 commands.spawn((
117 Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, 1.0, -PI / 4.)),
118 DirectionalLight {
119 shadows_enabled: true,
120 ..default()
121 },
122 CascadeShadowConfigBuilder {
123 first_cascade_far_bound: 200.0,
124 maximum_distance: 400.0,
125 ..default()
126 }
127 .build(),
128 ));
129}More examples
89fn spawn_scene(commands: &mut Commands, asset_server: &AssetServer) {
90 // Spawn the main scene.
91 commands.spawn(SceneRoot(asset_server.load(
92 GltfAssetLabel::Scene(0).from_asset("models/TonemappingTest/TonemappingTest.gltf"),
93 )));
94
95 // Spawn the flight helmet.
96 commands.spawn((
97 SceneRoot(
98 asset_server
99 .load(GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf")),
100 ),
101 Transform::from_xyz(0.5, 0.0, -0.5).with_rotation(Quat::from_rotation_y(-0.15 * PI)),
102 ));
103
104 // Spawn the light.
105 commands.spawn((
106 DirectionalLight {
107 illuminance: 15000.0,
108 shadows_enabled: true,
109 ..default()
110 },
111 Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, PI * -0.15, PI * -0.15)),
112 CascadeShadowConfigBuilder {
113 maximum_distance: 3.0,
114 first_cascade_far_bound: 0.9,
115 ..default()
116 }
117 .build(),
118 ));
119}344fn add_basic_scene(commands: &mut Commands, asset_server: &AssetServer) {
345 // Spawn the main scene.
346 commands.spawn(SceneRoot(asset_server.load(
347 GltfAssetLabel::Scene(0).from_asset("models/TonemappingTest/TonemappingTest.gltf"),
348 )));
349
350 // Spawn the flight helmet.
351 commands.spawn((
352 SceneRoot(
353 asset_server
354 .load(GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf")),
355 ),
356 Transform::from_xyz(0.5, 0.0, -0.5).with_rotation(Quat::from_rotation_y(-0.15 * PI)),
357 ));
358
359 // Spawn the light.
360 commands.spawn((
361 DirectionalLight {
362 illuminance: 15000.0,
363 shadows_enabled: true,
364 ..default()
365 },
366 Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, PI * -0.15, PI * -0.15)),
367 CascadeShadowConfigBuilder {
368 maximum_distance: 3.0,
369 first_cascade_far_bound: 0.9,
370 ..default()
371 }
372 .build(),
373 ));
374}99fn setup_basic_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
100 // Main scene
101 commands.spawn((
102 SceneRoot(asset_server.load(
103 GltfAssetLabel::Scene(0).from_asset("models/TonemappingTest/TonemappingTest.gltf"),
104 )),
105 SceneNumber(1),
106 ));
107
108 // Flight Helmet
109 commands.spawn((
110 SceneRoot(
111 asset_server
112 .load(GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf")),
113 ),
114 Transform::from_xyz(0.5, 0.0, -0.5).with_rotation(Quat::from_rotation_y(-0.15 * PI)),
115 SceneNumber(1),
116 ));
117
118 // light
119 commands.spawn((
120 DirectionalLight {
121 illuminance: 15_000.,
122 shadows_enabled: true,
123 ..default()
124 },
125 Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, PI * -0.15, PI * -0.15)),
126 CascadeShadowConfigBuilder {
127 maximum_distance: 3.0,
128 first_cascade_far_bound: 0.9,
129 ..default()
130 }
131 .build(),
132 SceneNumber(1),
133 ));
134}18fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
19 commands.spawn((
20 Camera3d::default(),
21 Transform::from_xyz(0.7, 0.7, 1.0).looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y),
22 EnvironmentMapLight {
23 diffuse_map: asset_server.load("environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"),
24 specular_map: asset_server.load("environment_maps/pisa_specular_rgb9e5_zstd.ktx2"),
25 intensity: 250.0,
26 ..default()
27 },
28 ));
29
30 commands.spawn((
31 DirectionalLight {
32 shadows_enabled: true,
33 ..default()
34 },
35 // This is a relatively small scene, so use tighter shadow
36 // cascade bounds than the default for better quality.
37 // We also adjusted the shadow map to be larger since we're
38 // only using a single cascade.
39 CascadeShadowConfigBuilder {
40 num_cascades: 1,
41 maximum_distance: 1.6,
42 ..default()
43 }
44 .build(),
45 ));
46 commands.spawn(SceneRoot(asset_server.load(
47 GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"),
48 )));
49}43fn setup_terrain_scene(
44 mut commands: Commands,
45 mut meshes: ResMut<Assets<Mesh>>,
46 mut materials: ResMut<Assets<StandardMaterial>>,
47 asset_server: Res<AssetServer>,
48) {
49 // Configure a properly scaled cascade shadow map for this scene (defaults are too large, mesh units are in km)
50 let cascade_shadow_config = CascadeShadowConfigBuilder {
51 first_cascade_far_bound: 0.3,
52 maximum_distance: 3.0,
53 ..default()
54 }
55 .build();
56
57 // Sun
58 commands.spawn((
59 DirectionalLight {
60 color: Color::srgb(0.98, 0.95, 0.82),
61 shadows_enabled: true,
62 ..default()
63 },
64 Transform::from_xyz(0.0, 0.0, 0.0).looking_at(Vec3::new(-0.15, -0.05, 0.25), Vec3::Y),
65 cascade_shadow_config,
66 ));
67
68 // Terrain
69 commands.spawn(SceneRoot(asset_server.load(
70 GltfAssetLabel::Scene(0).from_asset("models/terrain/Mountains.gltf"),
71 )));
72
73 // Sky
74 commands.spawn((
75 Mesh3d(meshes.add(Cuboid::new(2.0, 1.0, 1.0))),
76 MeshMaterial3d(materials.add(StandardMaterial {
77 base_color: Srgba::hex("888888").unwrap().into(),
78 unlit: true,
79 cull_mode: None,
80 ..default()
81 })),
82 Transform::from_scale(Vec3::splat(20.0)),
83 NotShadowCaster,
84 ));
85}- examples/animation/animated_mesh_events.rs
- examples/3d/visibility_range.rs
- examples/animation/animated_mesh_control.rs
- examples/3d/atmosphere.rs
- examples/3d/shadow_caster_receiver.rs
- examples/3d/anti_aliasing.rs
- examples/3d/meshlet.rs
- examples/3d/split_screen.rs
- examples/stress_tests/many_foxes.rs
- examples/3d/deferred_rendering.rs
- examples/3d/lighting.rs
Trait Implementations§
Source§impl Default for CascadeShadowConfigBuilder
impl Default for CascadeShadowConfigBuilder
Source§fn default() -> CascadeShadowConfigBuilder
fn default() -> CascadeShadowConfigBuilder
Source§impl From<CascadeShadowConfigBuilder> for CascadeShadowConfig
impl From<CascadeShadowConfigBuilder> for CascadeShadowConfig
Source§fn from(builder: CascadeShadowConfigBuilder) -> CascadeShadowConfig
fn from(builder: CascadeShadowConfigBuilder) -> CascadeShadowConfig
Auto Trait Implementations§
impl Freeze for CascadeShadowConfigBuilder
impl RefUnwindSafe for CascadeShadowConfigBuilder
impl Send for CascadeShadowConfigBuilder
impl Sync for CascadeShadowConfigBuilder
impl Unpin for CascadeShadowConfigBuilder
impl UnwindSafe for CascadeShadowConfigBuilder
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>, which can then be
downcast into Box<dyn 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>, which 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> 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> DowncastSend for T
impl<T> DowncastSend for T
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> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
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.