Struct Extrusion

Source
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,

Source

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
Hide additional 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>

Source§

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

Get a bounding sphere for the shape translated and rotated by the given isometry.
Source§

impl<T> Clone for Extrusion<T>
where T: Clone + Primitive2d,

Source§

fn clone(&self) -> Extrusion<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Extrusion<T>
where T: Debug + Primitive2d,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

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>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<P> From<Extrusion<P>> for Mesh

Source§

fn from(value: Extrusion<P>) -> Mesh

Converts to this type from the input type.
Source§

impl<T> Measured3d for Extrusion<T>

Source§

fn area(&self) -> f32

Get the surface area of the extrusion

Source§

fn volume(&self) -> f32

Get the volume of the extrusion

Source§

impl<P> Meshable for Extrusion<P>

Source§

type Output = ExtrusionBuilder<P>

The output of Self::mesh. This will be a MeshBuilder used for creating a Mesh.
Source§

fn mesh(&self) -> <Extrusion<P> as Meshable>::Output

Creates a Mesh for a shape.
Source§

impl<T> PartialEq for Extrusion<T>

Source§

fn eq(&self, other: &Extrusion<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Serialize for Extrusion<T>

Source§

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>
where P: Primitive2d + Measured2d + ShapeSample<Output = Vec2>,

Source§

type Output = Vec3

The type of vector returned by the sample methods, Vec2 for 2D shapes and Vec3 for 3D shapes.
Source§

fn sample_interior<R>( &self, rng: &mut R, ) -> <Extrusion<P> as ShapeSample>::Output
where R: Rng + ?Sized,

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
where R: Rng + ?Sized,

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,

Extract a Distribution whose samples are points of this shape’s interior, taken uniformly. Read more
Source§

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 more
Source§

impl<T> Copy for Extrusion<T>
where T: Copy + Primitive2d,

Source§

impl<T> Primitive3d for Extrusion<T>
where T: Primitive2d,

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

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> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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 T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> FmtForward for T

Source§

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,

Causes self to use its Display implementation when Debug-formatted.
Source§

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,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

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,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

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,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where 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) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

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

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
where Self: Borrow<B>, B: ?Sized,

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
where Self: BorrowMut<B>, B: ?Sized,

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
where Self: AsRef<R>, R: ?Sized,

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
where Self: AsMut<R>, R: ?Sized,

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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,