pub struct Extrusion<T>where
T: Primitive2d,{
pub base_shape: T,
pub half_depth: f32,
}
Expand description
A 3D shape representing an extruded 2D base_shape
.
Extruding a shape effectively “thickens” a 2D shapes, creating a shape with the same cross-section over the entire depth.
The resulting volumes are prisms. For example, a triangle becomes a triangular prism, while a circle becomes a cylinder.
Fields§
§base_shape: T
The base shape of the extrusion
half_depth: f32
Half of the depth of the extrusion
Implementations§
Source§impl<T> Extrusion<T>where
T: Primitive2d,
impl<T> Extrusion<T>where
T: Primitive2d,
Sourcepub fn new(base_shape: T, depth: f32) -> Extrusion<T>
pub fn new(base_shape: T, depth: f32) -> Extrusion<T>
Create a new Extrusion<T>
from a given base_shape
and depth
Examples found in repository?
examples/3d/3d_shapes.rs (line 71)
47fn setup(
48 mut commands: Commands,
49 mut meshes: ResMut<Assets<Mesh>>,
50 mut images: ResMut<Assets<Image>>,
51 mut materials: ResMut<Assets<StandardMaterial>>,
52) {
53 let debug_material = materials.add(StandardMaterial {
54 base_color_texture: Some(images.add(uv_debug_texture())),
55 ..default()
56 });
57
58 let shapes = [
59 meshes.add(Cuboid::default()),
60 meshes.add(Tetrahedron::default()),
61 meshes.add(Capsule3d::default()),
62 meshes.add(Torus::default()),
63 meshes.add(Cylinder::default()),
64 meshes.add(Cone::default()),
65 meshes.add(ConicalFrustum::default()),
66 meshes.add(Sphere::default().mesh().ico(5).unwrap()),
67 meshes.add(Sphere::default().mesh().uv(32, 18)),
68 ];
69
70 let extrusions = [
71 meshes.add(Extrusion::new(Rectangle::default(), 1.)),
72 meshes.add(Extrusion::new(Capsule2d::default(), 1.)),
73 meshes.add(Extrusion::new(Annulus::default(), 1.)),
74 meshes.add(Extrusion::new(Circle::default(), 1.)),
75 meshes.add(Extrusion::new(Ellipse::default(), 1.)),
76 meshes.add(Extrusion::new(RegularPolygon::default(), 1.)),
77 meshes.add(Extrusion::new(Triangle2d::default(), 1.)),
78 ];
79
80 let num_shapes = shapes.len();
81
82 for (i, shape) in shapes.into_iter().enumerate() {
83 commands.spawn((
84 Mesh3d(shape),
85 MeshMaterial3d(debug_material.clone()),
86 Transform::from_xyz(
87 -SHAPES_X_EXTENT / 2. + i as f32 / (num_shapes - 1) as f32 * SHAPES_X_EXTENT,
88 2.0,
89 Z_EXTENT / 2.,
90 )
91 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
92 Shape,
93 ));
94 }
95
96 let num_extrusions = extrusions.len();
97
98 for (i, shape) in extrusions.into_iter().enumerate() {
99 commands.spawn((
100 Mesh3d(shape),
101 MeshMaterial3d(debug_material.clone()),
102 Transform::from_xyz(
103 -EXTRUSION_X_EXTENT / 2.
104 + i as f32 / (num_extrusions - 1) as f32 * EXTRUSION_X_EXTENT,
105 2.0,
106 -Z_EXTENT / 2.,
107 )
108 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
109 Shape,
110 ));
111 }
112
113 commands.spawn((
114 PointLight {
115 shadows_enabled: true,
116 intensity: 10_000_000.,
117 range: 100.0,
118 shadow_depth_bias: 0.2,
119 ..default()
120 },
121 Transform::from_xyz(8.0, 16.0, 8.0),
122 ));
123
124 // ground plane
125 commands.spawn((
126 Mesh3d(meshes.add(Plane3d::default().mesh().size(50.0, 50.0).subdivisions(10))),
127 MeshMaterial3d(materials.add(Color::from(SILVER))),
128 ));
129
130 commands.spawn((
131 Camera3d::default(),
132 Transform::from_xyz(0.0, 7., 14.0).looking_at(Vec3::new(0., 1., 0.), Vec3::Y),
133 ));
134
135 #[cfg(not(target_arch = "wasm32"))]
136 commands.spawn((
137 Text::new("Press space to toggle wireframes"),
138 Node {
139 position_type: PositionType::Absolute,
140 top: Val::Px(12.0),
141 left: Val::Px(12.0),
142 ..default()
143 },
144 ));
145}
More examples
examples/picking/mesh_picking.rs (line 67)
43fn setup_scene(
44 mut commands: Commands,
45 mut meshes: ResMut<Assets<Mesh>>,
46 mut materials: ResMut<Assets<StandardMaterial>>,
47) {
48 // Set up the materials.
49 let white_matl = materials.add(Color::WHITE);
50 let ground_matl = materials.add(Color::from(GRAY_300));
51 let hover_matl = materials.add(Color::from(CYAN_300));
52 let pressed_matl = materials.add(Color::from(YELLOW_300));
53
54 let shapes = [
55 meshes.add(Cuboid::default()),
56 meshes.add(Tetrahedron::default()),
57 meshes.add(Capsule3d::default()),
58 meshes.add(Torus::default()),
59 meshes.add(Cylinder::default()),
60 meshes.add(Cone::default()),
61 meshes.add(ConicalFrustum::default()),
62 meshes.add(Sphere::default().mesh().ico(5).unwrap()),
63 meshes.add(Sphere::default().mesh().uv(32, 18)),
64 ];
65
66 let extrusions = [
67 meshes.add(Extrusion::new(Rectangle::default(), 1.)),
68 meshes.add(Extrusion::new(Capsule2d::default(), 1.)),
69 meshes.add(Extrusion::new(Annulus::default(), 1.)),
70 meshes.add(Extrusion::new(Circle::default(), 1.)),
71 meshes.add(Extrusion::new(Ellipse::default(), 1.)),
72 meshes.add(Extrusion::new(RegularPolygon::default(), 1.)),
73 meshes.add(Extrusion::new(Triangle2d::default(), 1.)),
74 ];
75
76 let num_shapes = shapes.len();
77
78 // Spawn the shapes. The meshes will be pickable by default.
79 for (i, shape) in shapes.into_iter().enumerate() {
80 commands
81 .spawn((
82 Mesh3d(shape),
83 MeshMaterial3d(white_matl.clone()),
84 Transform::from_xyz(
85 -SHAPES_X_EXTENT / 2. + i as f32 / (num_shapes - 1) as f32 * SHAPES_X_EXTENT,
86 2.0,
87 Z_EXTENT / 2.,
88 )
89 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
90 Shape,
91 ))
92 .observe(update_material_on::<Pointer<Over>>(hover_matl.clone()))
93 .observe(update_material_on::<Pointer<Out>>(white_matl.clone()))
94 .observe(update_material_on::<Pointer<Pressed>>(pressed_matl.clone()))
95 .observe(update_material_on::<Pointer<Released>>(hover_matl.clone()))
96 .observe(rotate_on_drag);
97 }
98
99 let num_extrusions = extrusions.len();
100
101 for (i, shape) in extrusions.into_iter().enumerate() {
102 commands
103 .spawn((
104 Mesh3d(shape),
105 MeshMaterial3d(white_matl.clone()),
106 Transform::from_xyz(
107 -EXTRUSION_X_EXTENT / 2.
108 + i as f32 / (num_extrusions - 1) as f32 * EXTRUSION_X_EXTENT,
109 2.0,
110 -Z_EXTENT / 2.,
111 )
112 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
113 Shape,
114 ))
115 .observe(update_material_on::<Pointer<Over>>(hover_matl.clone()))
116 .observe(update_material_on::<Pointer<Out>>(white_matl.clone()))
117 .observe(update_material_on::<Pointer<Pressed>>(pressed_matl.clone()))
118 .observe(update_material_on::<Pointer<Released>>(hover_matl.clone()))
119 .observe(rotate_on_drag);
120 }
121
122 // Ground
123 commands.spawn((
124 Mesh3d(meshes.add(Plane3d::default().mesh().size(50.0, 50.0).subdivisions(10))),
125 MeshMaterial3d(ground_matl.clone()),
126 Pickable::IGNORE, // Disable picking for the ground plane.
127 ));
128
129 // Light
130 commands.spawn((
131 PointLight {
132 shadows_enabled: true,
133 intensity: 10_000_000.,
134 range: 100.0,
135 shadow_depth_bias: 0.2,
136 ..default()
137 },
138 Transform::from_xyz(8.0, 16.0, 8.0),
139 ));
140
141 // Camera
142 commands.spawn((
143 Camera3d::default(),
144 Transform::from_xyz(0.0, 7., 14.0).looking_at(Vec3::new(0., 1., 0.), Vec3::Y),
145 ));
146
147 // Instructions
148 commands.spawn((
149 Text::new("Hover over the shapes to pick them\nDrag to rotate"),
150 Node {
151 position_type: PositionType::Absolute,
152 top: Val::Px(12.0),
153 left: Val::Px(12.0),
154 ..default()
155 },
156 ));
157}
Trait Implementations§
Source§impl<T> Bounded3d for Extrusion<T>where
T: BoundedExtrusion,
impl<T> Bounded3d for Extrusion<T>where
T: BoundedExtrusion,
Source§fn aabb_3d(&self, isometry: impl Into<Isometry3d>) -> Aabb3d
fn aabb_3d(&self, isometry: impl Into<Isometry3d>) -> Aabb3d
Get an axis-aligned bounding box for the shape translated and rotated by the given isometry.
Source§fn bounding_sphere(&self, isometry: impl Into<Isometry3d>) -> BoundingSphere
fn bounding_sphere(&self, isometry: impl Into<Isometry3d>) -> BoundingSphere
Get a bounding sphere for the shape translated and rotated by the given isometry.
Source§impl<'de, T> Deserialize<'de> for Extrusion<T>where
T: Primitive2d + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Extrusion<T>where
T: Primitive2d + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Extrusion<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Extrusion<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Measured3d for Extrusion<T>where
T: Primitive2d + Measured2d,
impl<T> Measured3d for Extrusion<T>where
T: Primitive2d + Measured2d,
Source§impl<T> Serialize for Extrusion<T>where
T: Primitive2d + Serialize,
impl<T> Serialize for Extrusion<T>where
T: Primitive2d + Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<P> ShapeSample for Extrusion<P>
impl<P> ShapeSample for Extrusion<P>
Source§fn sample_interior<R>(
&self,
rng: &mut R,
) -> <Extrusion<P> as ShapeSample>::Output
fn sample_interior<R>( &self, rng: &mut R, ) -> <Extrusion<P> as ShapeSample>::Output
Uniformly sample a point from inside the area/volume of this shape, centered on 0. Read more
Source§fn sample_boundary<R>(
&self,
rng: &mut R,
) -> <Extrusion<P> as ShapeSample>::Output
fn sample_boundary<R>( &self, rng: &mut R, ) -> <Extrusion<P> as ShapeSample>::Output
Uniformly sample a point from the surface of this shape, centered on 0. Read more
Source§fn interior_dist(self) -> impl Distribution<Self::Output>where
Self: Sized,
fn interior_dist(self) -> impl Distribution<Self::Output>where
Self: Sized,
Extract a
Distribution
whose samples are points of this shape’s interior, taken uniformly. Read moreSource§fn boundary_dist(self) -> impl Distribution<Self::Output>where
Self: Sized,
fn boundary_dist(self) -> impl Distribution<Self::Output>where
Self: Sized,
Extract a
Distribution
whose samples are points of this shape’s boundary, taken uniformly. Read moreimpl<T> Copy for Extrusion<T>where
T: Copy + Primitive2d,
impl<T> Primitive3d for Extrusion<T>where
T: Primitive2d,
impl<T> StructuralPartialEq for Extrusion<T>where
T: Primitive2d,
Auto Trait Implementations§
impl<T> Freeze for Extrusion<T>where
T: Freeze,
impl<T> RefUnwindSafe for Extrusion<T>where
T: RefUnwindSafe,
impl<T> Send for Extrusion<T>where
T: Send,
impl<T> Sync for Extrusion<T>where
T: Sync,
impl<T> Unpin for Extrusion<T>where
T: Unpin,
impl<T> UnwindSafe for Extrusion<T>where
T: UnwindSafe,
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
Return the
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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> ⓘ
Converts
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> ⓘ
Converts
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,
Pipes by value. This is generally the method you want to use. Read more
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,
Borrows
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,
Mutably borrows
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
Borrows
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
Mutably borrows
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
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
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
Immutable access to the
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
Mutable access to the
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
Immutable access to the
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
Mutable access to the
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
Immutable access to the
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
Mutable access to the
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
Calls
.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
Calls
.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
Calls
.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
Calls
.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
Calls
.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
Calls
.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
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.