PlaneMeshBuilder

Struct PlaneMeshBuilder 

Source
pub struct PlaneMeshBuilder {
    pub plane: Plane3d,
    pub subdivisions: u32,
}
Expand description

A builder used for creating a Mesh with a Plane3d shape.

Fields§

§plane: Plane3d

The Plane3d shape.

§subdivisions: u32

The number of subdivisions in the mesh.

0 - is the original plane geometry, the 4 points in the XZ plane.

1 - is split by 1 line in the middle of the plane on both the X axis and the Z axis, resulting in a plane with 4 quads / 8 triangles.

2 - is a plane split by 2 lines on both the X and Z axes, subdividing the plane into 3 equal sections along each axis, resulting in a plane with 9 quads / 18 triangles.

and so on…

Implementations§

Source§

impl PlaneMeshBuilder

Source

pub fn new(normal: Dir3, size: Vec2) -> PlaneMeshBuilder

Creates a new PlaneMeshBuilder from a given normal and size.

Source

pub fn from_size(size: Vec2) -> PlaneMeshBuilder

Creates a new PlaneMeshBuilder from the given size, with the normal pointing upwards.

Source

pub fn from_length(length: f32) -> PlaneMeshBuilder

Creates a new PlaneMeshBuilder from the given length, with the normal pointing upwards, and the resulting PlaneMeshBuilder being a square.

Source

pub fn normal(self, normal: Dir3) -> PlaneMeshBuilder

Sets the normal of the plane, aka the direction the plane is facing.

Examples found in repository?
tests/3d/test_invalid_skinned_mesh.rs (line 83)
28fn setup_environment(
29    mut commands: Commands,
30    mut mesh_assets: ResMut<Assets<Mesh>>,
31    mut material_assets: ResMut<Assets<StandardMaterial>>,
32) {
33    let description = "(left to right)\n\
34        0: Normal skinned mesh.\n\
35        1: Mesh asset is missing skinning attributes.\n\
36        2: One joint entity is missing.\n\
37        3: Mesh entity is missing SkinnedMesh component.";
38
39    commands.spawn((
40        Text::new(description),
41        Node {
42            position_type: PositionType::Absolute,
43            top: px(12),
44            left: px(12),
45            ..default()
46        },
47    ));
48
49    commands.spawn((
50        Camera3d::default(),
51        Transform::from_xyz(0.0, 0.0, 1.0).looking_at(Vec3::new(0.0, 0.0, 0.0), Vec3::Y),
52        Projection::Orthographic(OrthographicProjection {
53            scaling_mode: ScalingMode::AutoMin {
54                min_width: 19.0,
55                min_height: 6.0,
56            },
57            ..OrthographicProjection::default_3d()
58        }),
59        // Add motion blur so we can check if it's working for skinned meshes.
60        // This also exercises the renderer's prepass path.
61        MotionBlur {
62            // Use an unrealistically large shutter angle so that motion blur is clearly visible.
63            shutter_angle: 3.0,
64            samples: 2,
65        },
66        // MSAA and MotionBlur together are not compatible on WebGL.
67        #[cfg(all(feature = "webgl2", target_arch = "wasm32", not(feature = "webgpu")))]
68        Msaa::Off,
69    ));
70
71    // Add a directional light to make sure we exercise the renderer's shadow path.
72    commands.spawn((
73        Transform::from_xyz(1.0, 1.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y),
74        DirectionalLight {
75            shadows_enabled: true,
76            ..default()
77        },
78    ));
79
80    // Add a plane behind the meshes so we can see the shadows.
81    commands.spawn((
82        Transform::from_xyz(0.0, 0.0, -1.0),
83        Mesh3d(mesh_assets.add(Plane3d::default().mesh().size(100.0, 100.0).normal(Dir3::Z))),
84        MeshMaterial3d(material_assets.add(StandardMaterial {
85            base_color: Color::srgb(0.05, 0.05, 0.15),
86            reflectance: 0.2,
87            ..default()
88        })),
89    ));
90}
91
92fn setup_meshes(
93    mut commands: Commands,
94    mut mesh_assets: ResMut<Assets<Mesh>>,
95    mut material_assets: ResMut<Assets<StandardMaterial>>,
96    mut inverse_bindposes_assets: ResMut<Assets<SkinnedMeshInverseBindposes>>,
97) {
98    // Create a mesh with two rectangles.
99    let unskinned_mesh = Mesh::new(
100        PrimitiveTopology::TriangleList,
101        RenderAssetUsages::default(),
102    )
103    .with_inserted_attribute(
104        Mesh::ATTRIBUTE_POSITION,
105        vec![
106            [-0.3, -0.3, 0.0],
107            [0.3, -0.3, 0.0],
108            [-0.3, 0.3, 0.0],
109            [0.3, 0.3, 0.0],
110            [-0.4, 0.8, 0.0],
111            [0.4, 0.8, 0.0],
112            [-0.4, 1.8, 0.0],
113            [0.4, 1.8, 0.0],
114        ],
115    )
116    .with_inserted_attribute(Mesh::ATTRIBUTE_NORMAL, vec![[0.0, 0.0, 1.0]; 8])
117    .with_inserted_indices(Indices::U16(vec![0, 1, 3, 0, 3, 2, 4, 5, 7, 4, 7, 6]));
118
119    // Copy the mesh and add skinning attributes that bind each rectangle to a joint.
120    let skinned_mesh = unskinned_mesh
121        .clone()
122        .with_inserted_attribute(
123            Mesh::ATTRIBUTE_JOINT_INDEX,
124            VertexAttributeValues::Uint16x4(vec![
125                [0, 0, 0, 0],
126                [0, 0, 0, 0],
127                [0, 0, 0, 0],
128                [0, 0, 0, 0],
129                [1, 0, 0, 0],
130                [1, 0, 0, 0],
131                [1, 0, 0, 0],
132                [1, 0, 0, 0],
133            ]),
134        )
135        .with_inserted_attribute(
136            Mesh::ATTRIBUTE_JOINT_WEIGHT,
137            vec![[1.00, 0.00, 0.0, 0.0]; 8],
138        );
139
140    let unskinned_mesh_handle = mesh_assets.add(unskinned_mesh);
141    let skinned_mesh_handle = mesh_assets.add(skinned_mesh);
142
143    let inverse_bindposes_handle = inverse_bindposes_assets.add(vec![
144        Mat4::IDENTITY,
145        Mat4::from_translation(Vec3::new(0.0, -1.3, 0.0)),
146    ]);
147
148    let mesh_material_handle = material_assets.add(StandardMaterial::default());
149
150    let background_material_handle = material_assets.add(StandardMaterial {
151        base_color: Color::srgb(0.05, 0.15, 0.05),
152        reflectance: 0.2,
153        ..default()
154    });
155
156    #[derive(PartialEq)]
157    enum Variation {
158        Normal,
159        MissingMeshAttributes,
160        MissingJointEntity,
161        MissingSkinnedMeshComponent,
162    }
163
164    for (index, variation) in [
165        Variation::Normal,
166        Variation::MissingMeshAttributes,
167        Variation::MissingJointEntity,
168        Variation::MissingSkinnedMeshComponent,
169    ]
170    .into_iter()
171    .enumerate()
172    {
173        // Skip variations that are currently broken. See https://github.com/bevyengine/bevy/issues/16929,
174        // https://github.com/bevyengine/bevy/pull/18074.
175        if (variation == Variation::MissingSkinnedMeshComponent)
176            || (variation == Variation::MissingMeshAttributes)
177        {
178            continue;
179        }
180
181        let transform = Transform::from_xyz(((index as f32) - 1.5) * 4.5, 0.0, 0.0);
182
183        let joint_0 = commands.spawn(transform).id();
184
185        let joint_1 = commands
186            .spawn((ChildOf(joint_0), AnimatedJoint, Transform::IDENTITY))
187            .id();
188
189        if variation == Variation::MissingJointEntity {
190            commands.entity(joint_1).despawn();
191        }
192
193        let mesh_handle = match variation {
194            Variation::MissingMeshAttributes => &unskinned_mesh_handle,
195            _ => &skinned_mesh_handle,
196        };
197
198        let mut entity_commands = commands.spawn((
199            Mesh3d(mesh_handle.clone()),
200            MeshMaterial3d(mesh_material_handle.clone()),
201            transform,
202        ));
203
204        if variation != Variation::MissingSkinnedMeshComponent {
205            entity_commands.insert(SkinnedMesh {
206                inverse_bindposes: inverse_bindposes_handle.clone(),
207                joints: vec![joint_0, joint_1],
208            });
209        }
210
211        // Add a square behind the mesh to distinguish it from the other meshes.
212        commands.spawn((
213            Transform::from_xyz(transform.translation.x, transform.translation.y, -0.8),
214            Mesh3d(mesh_assets.add(Plane3d::default().mesh().size(4.3, 4.3).normal(Dir3::Z))),
215            MeshMaterial3d(background_material_handle.clone()),
216        ));
217    }
218}
Source

pub fn size(self, width: f32, height: f32) -> PlaneMeshBuilder

Sets the size of the plane mesh.

Examples found in repository?
examples/3d/3d_viewport_to_world.rs (line 52)
45fn setup(
46    mut commands: Commands,
47    mut meshes: ResMut<Assets<Mesh>>,
48    mut materials: ResMut<Assets<StandardMaterial>>,
49) {
50    // plane
51    commands.spawn((
52        Mesh3d(meshes.add(Plane3d::default().mesh().size(20., 20.))),
53        MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
54        Ground,
55    ));
56
57    // light
58    commands.spawn((
59        DirectionalLight::default(),
60        Transform::from_translation(Vec3::ONE).looking_at(Vec3::ZERO, Vec3::Y),
61    ));
62
63    // camera
64    commands.spawn((
65        Camera3d::default(),
66        Transform::from_xyz(15.0, 5.0, 15.0).looking_at(Vec3::ZERO, Vec3::Y),
67    ));
68}
More examples
Hide additional examples
examples/asset/multi_asset_sync.rs (line 207)
185fn setup_scene(
186    mut commands: Commands,
187    mut meshes: ResMut<Assets<Mesh>>,
188    mut materials: ResMut<Assets<StandardMaterial>>,
189) {
190    // Camera
191    commands.spawn((
192        Camera3d::default(),
193        Transform::from_xyz(10.0, 10.0, 15.0).looking_at(Vec3::new(0.0, 0.0, 0.0), Vec3::Y),
194    ));
195
196    // Light
197    commands.spawn((
198        DirectionalLight {
199            shadows_enabled: true,
200            ..default()
201        },
202        Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, 1.0, -PI / 4.)),
203    ));
204
205    // Plane
206    commands.spawn((
207        Mesh3d(meshes.add(Plane3d::default().mesh().size(50000.0, 50000.0))),
208        MeshMaterial3d(materials.add(Color::srgb(0.7, 0.2, 0.2))),
209        Loading,
210    ));
211}
212
213// A run condition for all assets being loaded.
214fn assets_loaded(barrier: Option<Res<AssetBarrier>>) -> bool {
215    // If our barrier isn't ready, return early and wait another cycle
216    barrier.map(|b| b.is_ready()) == Some(true)
217}
218
219// This showcases how to wait for assets using sync code and systems.
220//
221// This function only runs if `assets_loaded` returns true.
222fn wait_on_load(
223    mut commands: Commands,
224    foxes: Res<OneHundredThings>,
225    gltfs: Res<Assets<Gltf>>,
226    mut meshes: ResMut<Assets<Mesh>>,
227    mut materials: ResMut<Assets<StandardMaterial>>,
228) {
229    // Change color of plane to green
230    commands.spawn((
231        Mesh3d(meshes.add(Plane3d::default().mesh().size(50000.0, 50000.0))),
232        MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
233        Transform::from_translation(Vec3::Z * -0.01),
234    ));
235
236    // Spawn our scenes.
237    for i in 0..10 {
238        for j in 0..10 {
239            let index = i * 10 + j;
240            let position = Vec3::new(i as f32 - 5.0, 0.0, j as f32 - 5.0);
241            // All gltfs must exist because this is guarded by the `AssetBarrier`.
242            let gltf = gltfs.get(&foxes.0[index]).unwrap();
243            let scene = gltf.scenes.first().unwrap().clone();
244            commands.spawn((SceneRoot(scene), Transform::from_translation(position)));
245        }
246    }
247}
tests/window/minimizing.rs (line 37)
30fn setup_3d(
31    mut commands: Commands,
32    mut meshes: ResMut<Assets<Mesh>>,
33    mut materials: ResMut<Assets<StandardMaterial>>,
34) {
35    // plane
36    commands.spawn((
37        Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
38        MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
39    ));
40    // cube
41    commands.spawn((
42        Mesh3d(meshes.add(Cuboid::default())),
43        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
44        Transform::from_xyz(0.0, 0.5, 0.0),
45    ));
46    // light
47    commands.spawn((
48        PointLight {
49            shadows_enabled: true,
50            ..default()
51        },
52        Transform::from_xyz(4.0, 8.0, 4.0),
53    ));
54    // camera
55    commands.spawn((
56        Camera3d::default(),
57        Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
58    ));
59}
tests/window/resizing.rs (line 113)
106fn setup_3d(
107    mut commands: Commands,
108    mut meshes: ResMut<Assets<Mesh>>,
109    mut materials: ResMut<Assets<StandardMaterial>>,
110) {
111    // plane
112    commands.spawn((
113        Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
114        MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
115    ));
116    // cube
117    commands.spawn((
118        Mesh3d(meshes.add(Cuboid::default())),
119        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
120        Transform::from_xyz(0.0, 0.5, 0.0),
121    ));
122    // light
123    commands.spawn((
124        PointLight {
125            shadows_enabled: true,
126            ..default()
127        },
128        Transform::from_xyz(4.0, 8.0, 4.0),
129    ));
130    // camera
131    commands.spawn((
132        Camera3d::default(),
133        Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
134    ));
135}
examples/animation/animated_mesh.rs (line 111)
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}
examples/shader/shader_material_screenspace_texture.rs (line 29)
21fn setup(
22    mut commands: Commands,
23    asset_server: Res<AssetServer>,
24    mut meshes: ResMut<Assets<Mesh>>,
25    mut custom_materials: ResMut<Assets<CustomMaterial>>,
26    mut standard_materials: ResMut<Assets<StandardMaterial>>,
27) {
28    commands.spawn((
29        Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
30        MeshMaterial3d(standard_materials.add(Color::srgb(0.3, 0.5, 0.3))),
31    ));
32    commands.spawn((PointLight::default(), Transform::from_xyz(4.0, 8.0, 4.0)));
33
34    commands.spawn((
35        Mesh3d(meshes.add(Cuboid::default())),
36        MeshMaterial3d(custom_materials.add(CustomMaterial {
37            texture: asset_server.load(
38                "models/FlightHelmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png",
39            ),
40        })),
41        Transform::from_xyz(0.0, 0.5, 0.0),
42    ));
43
44    // camera
45    commands.spawn((
46        Camera3d::default(),
47        Transform::from_xyz(4.0, 2.5, 4.0).looking_at(Vec3::ZERO, Vec3::Y),
48        MainCamera,
49    ));
50}
Source

pub fn subdivisions(self, subdivisions: u32) -> PlaneMeshBuilder

Sets the subdivisions of the plane mesh.

0 - is the original plane geometry, the 4 points in the XZ plane.

1 - is split by 1 line in the middle of the plane on both the X axis and the Z axis, resulting in a plane with 4 quads / 8 triangles.

2 - is a plane split by 2 lines on both the X and Z axes, subdividing the plane into 3 equal sections along each axis, resulting in a plane with 9 quads / 18 triangles.

Examples found in repository?
examples/3d/3d_shapes.rs (line 139)
54fn setup(
55    mut commands: Commands,
56    mut meshes: ResMut<Assets<Mesh>>,
57    mut images: ResMut<Assets<Image>>,
58    mut materials: ResMut<Assets<StandardMaterial>>,
59) {
60    let debug_material = materials.add(StandardMaterial {
61        base_color_texture: Some(images.add(uv_debug_texture())),
62        ..default()
63    });
64
65    let shapes = [
66        meshes.add(Cuboid::default()),
67        meshes.add(Tetrahedron::default()),
68        meshes.add(Capsule3d::default()),
69        meshes.add(Torus::default()),
70        meshes.add(Cylinder::default()),
71        meshes.add(Cone::default()),
72        meshes.add(ConicalFrustum::default()),
73        meshes.add(Sphere::default().mesh().ico(5).unwrap()),
74        meshes.add(Sphere::default().mesh().uv(32, 18)),
75        meshes.add(Segment3d::default()),
76        meshes.add(Polyline3d::new(vec![
77            Vec3::new(-0.5, 0.0, 0.0),
78            Vec3::new(0.5, 0.0, 0.0),
79            Vec3::new(0.0, 0.5, 0.0),
80        ])),
81    ];
82
83    let extrusions = [
84        meshes.add(Extrusion::new(Rectangle::default(), 1.)),
85        meshes.add(Extrusion::new(Capsule2d::default(), 1.)),
86        meshes.add(Extrusion::new(Annulus::default(), 1.)),
87        meshes.add(Extrusion::new(Circle::default(), 1.)),
88        meshes.add(Extrusion::new(Ellipse::default(), 1.)),
89        meshes.add(Extrusion::new(RegularPolygon::default(), 1.)),
90        meshes.add(Extrusion::new(Triangle2d::default(), 1.)),
91    ];
92
93    let num_shapes = shapes.len();
94
95    for (i, shape) in shapes.into_iter().enumerate() {
96        commands.spawn((
97            Mesh3d(shape),
98            MeshMaterial3d(debug_material.clone()),
99            Transform::from_xyz(
100                -SHAPES_X_EXTENT / 2. + i as f32 / (num_shapes - 1) as f32 * SHAPES_X_EXTENT,
101                2.0,
102                Z_EXTENT / 2.,
103            )
104            .with_rotation(Quat::from_rotation_x(-PI / 4.)),
105            Shape,
106        ));
107    }
108
109    let num_extrusions = extrusions.len();
110
111    for (i, shape) in extrusions.into_iter().enumerate() {
112        commands.spawn((
113            Mesh3d(shape),
114            MeshMaterial3d(debug_material.clone()),
115            Transform::from_xyz(
116                -EXTRUSION_X_EXTENT / 2.
117                    + i as f32 / (num_extrusions - 1) as f32 * EXTRUSION_X_EXTENT,
118                2.0,
119                -Z_EXTENT / 2.,
120            )
121            .with_rotation(Quat::from_rotation_x(-PI / 4.)),
122            Shape,
123        ));
124    }
125
126    commands.spawn((
127        PointLight {
128            shadows_enabled: true,
129            intensity: 10_000_000.,
130            range: 100.0,
131            shadow_depth_bias: 0.2,
132            ..default()
133        },
134        Transform::from_xyz(8.0, 16.0, 8.0),
135    ));
136
137    // ground plane
138    commands.spawn((
139        Mesh3d(meshes.add(Plane3d::default().mesh().size(50.0, 50.0).subdivisions(10))),
140        MeshMaterial3d(materials.add(Color::from(SILVER))),
141    ));
142
143    commands.spawn((
144        Camera3d::default(),
145        Transform::from_xyz(0.0, 7., 14.0).looking_at(Vec3::new(0., 1., 0.), Vec3::Y),
146    ));
147
148    #[cfg(not(target_arch = "wasm32"))]
149    commands.spawn((
150        Text::new("Press space to toggle wireframes"),
151        Node {
152            position_type: PositionType::Absolute,
153            top: px(12),
154            left: px(12),
155            ..default()
156        },
157    ));
158}
More examples
Hide additional examples
examples/picking/mesh_picking.rs (line 124)
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<Press>>(pressed_matl.clone()))
95            .observe(update_material_on::<Pointer<Release>>(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<Press>>(pressed_matl.clone()))
118            .observe(update_material_on::<Pointer<Release>>(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: px(12),
153            left: px(12),
154            ..default()
155        },
156    ));
157}

Trait Implementations§

Source§

impl Clone for PlaneMeshBuilder

Source§

fn clone(&self) -> PlaneMeshBuilder

Returns a duplicate 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 Debug for PlaneMeshBuilder

Source§

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

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

impl Default for PlaneMeshBuilder

Source§

fn default() -> PlaneMeshBuilder

Returns the “default value” for a type. Read more
Source§

impl FromArg for PlaneMeshBuilder

Source§

type This<'from_arg> = PlaneMeshBuilder

The type to convert into. Read more
Source§

fn from_arg( arg: Arg<'_>, ) -> Result<<PlaneMeshBuilder as FromArg>::This<'_>, ArgError>

Creates an item from an argument. Read more
Source§

impl FromReflect for PlaneMeshBuilder

Source§

fn from_reflect( reflect: &(dyn PartialReflect + 'static), ) -> Option<PlaneMeshBuilder>

Constructs a concrete instance of Self from a reflected value.
Source§

fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Source§

impl GetOwnership for PlaneMeshBuilder

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl GetTypeRegistration for PlaneMeshBuilder

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl IntoReturn for PlaneMeshBuilder

Source§

fn into_return<'into_return>(self) -> Return<'into_return>
where PlaneMeshBuilder: 'into_return,

Converts Self into a Return value.
Source§

impl MeshBuilder for PlaneMeshBuilder

Source§

fn build(&self) -> Mesh

Builds a Mesh based on the configuration in self.
Source§

impl PartialReflect for PlaneMeshBuilder

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<PlaneMeshBuilder>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<PlaneMeshBuilder>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect(self: Box<PlaneMeshBuilder>) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

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

Debug formatter for the value. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
Source§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
Source§

fn to_dynamic(&self) -> Box<dyn PartialReflect>

Converts this reflected value into its dynamic representation based on its kind. Read more
Source§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing PartialReflect, combines reflect_clone and take in a useful fashion, automatically constructing an appropriate ReflectCloneError if the downcast fails. Read more
Source§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
Source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl Reflect for PlaneMeshBuilder

Source§

fn into_any(self: Box<PlaneMeshBuilder>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>. Read more
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the value as a &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<PlaneMeshBuilder>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &(dyn Reflect + 'static)

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl Struct for PlaneMeshBuilder

Source§

fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>

Returns a reference to the value of the field named name as a &dyn PartialReflect.
Source§

fn field_mut( &mut self, name: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>

Returns a mutable reference to the value of the field named name as a &mut dyn PartialReflect.
Source§

fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>

Returns a reference to the value of the field with index index as a &dyn PartialReflect.
Source§

fn field_at_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>

Returns a mutable reference to the value of the field with index index as a &mut dyn PartialReflect.
Source§

fn name_at(&self, index: usize) -> Option<&str>

Returns the name of the field with index index.
Source§

fn field_len(&self) -> usize

Returns the number of fields in the struct.
Source§

fn iter_fields(&self) -> FieldIter<'_>

Returns an iterator over the values of the reflectable fields for this struct.
Source§

fn to_dynamic_struct(&self) -> DynamicStruct

Creates a new DynamicStruct from this struct.
Source§

fn get_represented_struct_info(&self) -> Option<&'static StructInfo>

Will return None if TypeInfo is not available.
Source§

impl TypePath for PlaneMeshBuilder

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl Typed for PlaneMeshBuilder

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
Source§

impl Copy for PlaneMeshBuilder

Auto Trait Implementations§

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 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> DynamicTypePath for T
where T: TypePath,

Source§

impl<T> DynamicTyped for T
where T: Typed,

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> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<S> GetField for S
where S: Struct,

Source§

fn get_field<T>(&self, name: &str) -> Option<&T>
where T: Reflect,

Returns a reference to the value of the field named name, downcast to T.
Source§

fn get_field_mut<T>(&mut self, name: &str) -> Option<&mut T>
where T: Reflect,

Returns a mutable reference to the value of the field named name, downcast to T.
Source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

Source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Source§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
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<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

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

Source§

fn into_sample(self) -> T

Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
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§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> Reflectable for T

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,