Struct OrthographicProjection

Source
pub struct OrthographicProjection {
    pub near: f32,
    pub far: f32,
    pub viewport_origin: Vec2,
    pub scaling_mode: ScalingMode,
    pub scale: f32,
    pub area: Rect,
}
Expand description

Project a 3D space onto a 2D surface using parallel lines, i.e., unlike PerspectiveProjection, the size of objects remains the same regardless of their distance to the camera.

The volume contained in the projection is called the view frustum. Since the viewport is rectangular and projection lines are parallel, the view frustum takes the shape of a cuboid.

Note that the scale of the projection and the apparent size of objects are inversely proportional. As the size of the projection increases, the size of objects decreases.

§Examples

Configure the orthographic projection to one world unit per 100 window pixels:

let projection = Projection::Orthographic(OrthographicProjection {
    scaling_mode: ScalingMode::WindowSize,
    scale: 0.01,
    ..OrthographicProjection::default_2d()
});

Fields§

§near: f32

The distance of the near clipping plane in world units.

Objects closer than this will not be rendered.

Defaults to 0.0

§far: f32

The distance of the far clipping plane in world units.

Objects further than this will not be rendered.

Defaults to 1000.0

§viewport_origin: Vec2

Specifies the origin of the viewport as a normalized position from 0 to 1, where (0, 0) is the bottom left and (1, 1) is the top right. This determines where the camera’s position sits inside the viewport.

When the projection scales due to viewport resizing, the position of the camera, and thereby viewport_origin, remains at the same relative point.

Consequently, this is pivot point when scaling. With a bottom left pivot, the projection will expand upwards and to the right. With a top right pivot, the projection will expand downwards and to the left. Values in between will caused the projection to scale proportionally on each axis.

Defaults to (0.5, 0.5), which makes scaling affect opposite sides equally, keeping the center point of the viewport centered.

§scaling_mode: ScalingMode

How the projection will scale to the viewport.

Defaults to ScalingMode::WindowSize, and works in concert with OrthographicProjection::scale to determine the final effect.

For simplicity, zooming should be done by changing OrthographicProjection::scale, rather than changing the parameters of the scaling mode.

§scale: f32

Scales the projection.

As scale increases, the apparent size of objects decreases, and vice versa.

Note: scaling can be set by scaling_mode as well. This parameter scales on top of that.

This property is particularly useful in implementing zoom functionality.

Defaults to 1.0, which under standard settings corresponds to a 1:1 mapping of world units to rendered pixels. See ScalingMode::WindowSize for more information.

§area: Rect

The area that the projection covers relative to viewport_origin.

Bevy’s camera_system automatically updates this value when the viewport is resized depending on OrthographicProjection’s other fields. In this case, area should not be manually modified.

It may be necessary to set this manually for shadow projections and such.

Implementations§

Source§

impl OrthographicProjection

Source

pub fn default_2d() -> OrthographicProjection

Returns the default orthographic projection for a 2D context.

The near plane is set to a negative value so that the camera can still render the scene when using positive z coordinates to order foreground elements.

Source

pub fn default_3d() -> OrthographicProjection

Returns the default orthographic projection for a 3D context.

The near plane is set to 0.0 so that the camera doesn’t render objects that are behind it.

Examples found in repository?
examples/3d/orthographic.rs (line 26)
13fn setup(
14    mut commands: Commands,
15    mut meshes: ResMut<Assets<Mesh>>,
16    mut materials: ResMut<Assets<StandardMaterial>>,
17) {
18    // camera
19    commands.spawn((
20        Camera3d::default(),
21        Projection::from(OrthographicProjection {
22            // 6 world units per pixel of window height.
23            scaling_mode: ScalingMode::FixedVertical {
24                viewport_height: 6.0,
25            },
26            ..OrthographicProjection::default_3d()
27        }),
28        Transform::from_xyz(5.0, 5.0, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
29    ));
30
31    // plane
32    commands.spawn((
33        Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
34        MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
35    ));
36    // cubes
37    commands.spawn((
38        Mesh3d(meshes.add(Cuboid::default())),
39        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
40        Transform::from_xyz(1.5, 0.5, 1.5),
41    ));
42    commands.spawn((
43        Mesh3d(meshes.add(Cuboid::default())),
44        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
45        Transform::from_xyz(1.5, 0.5, -1.5),
46    ));
47    commands.spawn((
48        Mesh3d(meshes.add(Cuboid::default())),
49        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
50        Transform::from_xyz(-1.5, 0.5, 1.5),
51    ));
52    commands.spawn((
53        Mesh3d(meshes.add(Cuboid::default())),
54        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
55        Transform::from_xyz(-1.5, 0.5, -1.5),
56    ));
57    // light
58    commands.spawn((PointLight::default(), Transform::from_xyz(3.0, 8.0, 5.0)));
59}
More examples
Hide additional examples
examples/camera/projection_zoom.rs (line 62)
43fn setup(
44    asset_server: Res<AssetServer>,
45    camera_settings: Res<CameraSettings>,
46    mut commands: Commands,
47    mut meshes: ResMut<Assets<Mesh>>,
48    mut materials: ResMut<Assets<StandardMaterial>>,
49) {
50    commands.spawn((
51        Name::new("Camera"),
52        Camera3d::default(),
53        Projection::from(OrthographicProjection {
54            // We can set the scaling mode to FixedVertical to keep the viewport height constant as its aspect ratio changes.
55            // The viewport height is the height of the camera's view in world units when the scale is 1.
56            scaling_mode: ScalingMode::FixedVertical {
57                viewport_height: camera_settings.orthographic_viewport_height,
58            },
59            // This is the default value for scale for orthographic projections.
60            // To zoom in and out, change this value, rather than `ScalingMode` or the camera's position.
61            scale: 1.,
62            ..OrthographicProjection::default_3d()
63        }),
64        Transform::from_xyz(5.0, 5.0, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
65    ));
66
67    commands.spawn((
68        Name::new("Plane"),
69        Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
70        MeshMaterial3d(materials.add(StandardMaterial {
71            base_color: Color::srgb(0.3, 0.5, 0.3),
72            // Turning off culling keeps the plane visible when viewed from beneath.
73            cull_mode: None,
74            ..default()
75        })),
76    ));
77
78    commands.spawn((
79        Name::new("Fox"),
80        SceneRoot(
81            asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/animated/Fox.glb")),
82        ),
83        // Note: the scale adjustment is purely an accident of our fox model, which renders
84        // HUGE unless mitigated!
85        Transform::from_translation(Vec3::splat(0.0)).with_scale(Vec3::splat(0.025)),
86    ));
87
88    commands.spawn((
89        Name::new("Light"),
90        PointLight::default(),
91        Transform::from_xyz(3.0, 8.0, 5.0),
92    ));
93}
94
95fn instructions(mut commands: Commands) {
96    commands.spawn((
97        Name::new("Instructions"),
98        Text::new(
99            "Scroll mouse wheel to zoom in/out\n\
100            Space: switch between orthographic and perspective projections",
101        ),
102        Node {
103            position_type: PositionType::Absolute,
104            top: Val::Px(12.),
105            left: Val::Px(12.),
106            ..default()
107        },
108    ));
109}
110
111fn switch_projection(
112    mut camera: Single<&mut Projection, With<Camera>>,
113    camera_settings: Res<CameraSettings>,
114    keyboard_input: Res<ButtonInput<KeyCode>>,
115) {
116    if keyboard_input.just_pressed(KeyCode::Space) {
117        // Switch projection type
118        **camera = match **camera {
119            Projection::Orthographic(_) => Projection::Perspective(PerspectiveProjection {
120                fov: camera_settings.perspective_zoom_range.start,
121                ..default()
122            }),
123            Projection::Perspective(_) => Projection::Orthographic(OrthographicProjection {
124                scaling_mode: ScalingMode::FixedVertical {
125                    viewport_height: camera_settings.orthographic_viewport_height,
126                },
127                ..OrthographicProjection::default_3d()
128            }),
129            _ => return,
130        }
131    }
132}
examples/stress_tests/many_lights.rs (line 99)
44fn setup(
45    mut commands: Commands,
46    mut meshes: ResMut<Assets<Mesh>>,
47    mut materials: ResMut<Assets<StandardMaterial>>,
48) {
49    warn!(include_str!("warning_string.txt"));
50
51    const LIGHT_RADIUS: f32 = 0.3;
52    const LIGHT_INTENSITY: f32 = 1000.0;
53    const RADIUS: f32 = 50.0;
54    const N_LIGHTS: usize = 100_000;
55
56    commands.spawn((
57        Mesh3d(meshes.add(Sphere::new(RADIUS).mesh().ico(9).unwrap())),
58        MeshMaterial3d(materials.add(Color::WHITE)),
59        Transform::from_scale(Vec3::NEG_ONE),
60    ));
61
62    let mesh = meshes.add(Cuboid::default());
63    let material = materials.add(StandardMaterial {
64        base_color: DEEP_PINK.into(),
65        ..default()
66    });
67
68    // NOTE: This pattern is good for testing performance of culling as it provides roughly
69    // the same number of visible meshes regardless of the viewing angle.
70    // NOTE: f64 is used to avoid precision issues that produce visual artifacts in the distribution
71    let golden_ratio = 0.5f64 * (1.0f64 + 5.0f64.sqrt());
72
73    // Spawn N_LIGHTS many lights
74    commands.spawn_batch((0..N_LIGHTS).map(move |i| {
75        let mut rng = thread_rng();
76
77        let spherical_polar_theta_phi = fibonacci_spiral_on_sphere(golden_ratio, i, N_LIGHTS);
78        let unit_sphere_p = spherical_polar_to_cartesian(spherical_polar_theta_phi);
79
80        (
81            PointLight {
82                range: LIGHT_RADIUS,
83                intensity: LIGHT_INTENSITY,
84                color: Color::hsl(rng.gen_range(0.0..360.0), 1.0, 0.5),
85                ..default()
86            },
87            Transform::from_translation((RADIUS as f64 * unit_sphere_p).as_vec3()),
88        )
89    }));
90
91    // camera
92    match std::env::args().nth(1).as_deref() {
93        Some("orthographic") => commands.spawn((
94            Camera3d::default(),
95            Projection::from(OrthographicProjection {
96                scaling_mode: ScalingMode::FixedHorizontal {
97                    viewport_width: 20.0,
98                },
99                ..OrthographicProjection::default_3d()
100            }),
101        )),
102        _ => commands.spawn(Camera3d::default()),
103    };
104
105    // add one cube, the only one with strong handles
106    // also serves as a reference point during rotation
107    commands.spawn((
108        Mesh3d(mesh),
109        MeshMaterial3d(material),
110        Transform {
111            translation: Vec3::new(0.0, RADIUS, 0.0),
112            scale: Vec3::splat(5.0),
113            ..default()
114        },
115    ));
116}
examples/3d/pbr.rs (line 116)
15fn setup(
16    mut commands: Commands,
17    mut meshes: ResMut<Assets<Mesh>>,
18    mut materials: ResMut<Assets<StandardMaterial>>,
19    asset_server: Res<AssetServer>,
20) {
21    let sphere_mesh = meshes.add(Sphere::new(0.45));
22    // add entities to the world
23    for y in -2..=2 {
24        for x in -5..=5 {
25            let x01 = (x + 5) as f32 / 10.0;
26            let y01 = (y + 2) as f32 / 4.0;
27            // sphere
28            commands.spawn((
29                Mesh3d(sphere_mesh.clone()),
30                MeshMaterial3d(materials.add(StandardMaterial {
31                    base_color: Srgba::hex("#ffd891").unwrap().into(),
32                    // vary key PBR parameters on a grid of spheres to show the effect
33                    metallic: y01,
34                    perceptual_roughness: x01,
35                    ..default()
36                })),
37                Transform::from_xyz(x as f32, y as f32 + 0.5, 0.0),
38            ));
39        }
40    }
41    // unlit sphere
42    commands.spawn((
43        Mesh3d(sphere_mesh),
44        MeshMaterial3d(materials.add(StandardMaterial {
45            base_color: Srgba::hex("#ffd891").unwrap().into(),
46            // vary key PBR parameters on a grid of spheres to show the effect
47            unlit: true,
48            ..default()
49        })),
50        Transform::from_xyz(-5.0, -2.5, 0.0),
51    ));
52
53    commands.spawn((
54        DirectionalLight {
55            illuminance: 1_500.,
56            ..default()
57        },
58        Transform::from_xyz(50.0, 50.0, 50.0).looking_at(Vec3::ZERO, Vec3::Y),
59    ));
60
61    // labels
62    commands.spawn((
63        Text::new("Perceptual Roughness"),
64        TextFont {
65            font_size: 30.0,
66            ..default()
67        },
68        Node {
69            position_type: PositionType::Absolute,
70            top: Val::Px(20.0),
71            left: Val::Px(100.0),
72            ..default()
73        },
74    ));
75
76    commands.spawn((
77        Text::new("Metallic"),
78        TextFont {
79            font_size: 30.0,
80            ..default()
81        },
82        Node {
83            position_type: PositionType::Absolute,
84            top: Val::Px(130.0),
85            right: Val::ZERO,
86            ..default()
87        },
88        Transform {
89            rotation: Quat::from_rotation_z(std::f32::consts::PI / 2.0),
90            ..default()
91        },
92    ));
93
94    commands.spawn((
95        Text::new("Loading Environment Map..."),
96        TextFont {
97            font_size: 30.0,
98            ..default()
99        },
100        Node {
101            position_type: PositionType::Absolute,
102            bottom: Val::Px(20.0),
103            right: Val::Px(20.0),
104            ..default()
105        },
106        EnvironmentMapLabel,
107    ));
108
109    // camera
110    commands.spawn((
111        Camera3d::default(),
112        Transform::from_xyz(0.0, 0.0, 8.0).looking_at(Vec3::default(), Vec3::Y),
113        Projection::from(OrthographicProjection {
114            scale: 0.01,
115            scaling_mode: ScalingMode::WindowSize,
116            ..OrthographicProjection::default_3d()
117        }),
118        EnvironmentMapLight {
119            diffuse_map: asset_server.load("environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"),
120            specular_map: asset_server.load("environment_maps/pisa_specular_rgb9e5_zstd.ktx2"),
121            intensity: 900.0,
122            ..default()
123        },
124    ));
125}
examples/3d/camera_sub_view.rs (line 147)
26fn setup(
27    mut commands: Commands,
28    mut meshes: ResMut<Assets<Mesh>>,
29    mut materials: ResMut<Assets<StandardMaterial>>,
30) {
31    let transform = Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y);
32
33    // Plane
34    commands.spawn((
35        Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
36        MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
37    ));
38
39    // Cube
40    commands.spawn((
41        Mesh3d(meshes.add(Cuboid::default())),
42        MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
43        Transform::from_xyz(0.0, 0.5, 0.0),
44    ));
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
55    // Main perspective camera:
56    //
57    // The main perspective image to use as a comparison for the sub views.
58    commands.spawn((
59        Camera3d::default(),
60        Camera::default(),
61        ExampleViewports::PerspectiveMain,
62        transform,
63    ));
64
65    // Perspective camera right half:
66    //
67    // For this camera, the projection is perspective, and `size` is half the
68    // width of the `full_size`, while the x value of `offset` is set to half
69    // the value of the full width, causing the right half of the image to be
70    // shown. Since the viewport has an aspect ratio of 1x1 and the sub view has
71    // an aspect ratio of 1x2, the image appears stretched along the horizontal
72    // axis.
73    commands.spawn((
74        Camera3d::default(),
75        Camera {
76            sub_camera_view: Some(SubCameraView {
77                // The values of `full_size` and `size` do not have to be the
78                // exact values of your physical viewport. The important part is
79                // the ratio between them.
80                full_size: UVec2::new(10, 10),
81                // The `offset` is also relative to the values in `full_size`
82                // and `size`
83                offset: Vec2::new(5.0, 0.0),
84                size: UVec2::new(5, 10),
85            }),
86            order: 1,
87            ..default()
88        },
89        ExampleViewports::PerspectiveStretched,
90        transform,
91    ));
92
93    // Perspective camera moving:
94    //
95    // For this camera, the projection is perspective, and the offset is updated
96    // continuously in 150 units per second in `move_camera_view`. Since the
97    // `full_size` is 500x500, the image should appear to be moving across the
98    // full image once every 3.3 seconds. `size` is a fifth of the size of
99    // `full_size`, so the image will appear zoomed in.
100    commands.spawn((
101        Camera3d::default(),
102        Camera {
103            sub_camera_view: Some(SubCameraView {
104                full_size: UVec2::new(500, 500),
105                offset: Vec2::ZERO,
106                size: UVec2::new(100, 100),
107            }),
108            order: 2,
109            ..default()
110        },
111        transform,
112        ExampleViewports::PerspectiveMoving,
113        MovingCameraMarker,
114    ));
115
116    // Perspective camera different aspect ratio:
117    //
118    // For this camera, the projection is perspective, and the aspect ratio of
119    // the sub view (2x1) is different to the aspect ratio of the full view
120    // (2x2). The aspect ratio of the sub view matches the aspect ratio of
121    // the viewport and should show an unstretched image of the top half of the
122    // full perspective image.
123    commands.spawn((
124        Camera3d::default(),
125        Camera {
126            sub_camera_view: Some(SubCameraView {
127                full_size: UVec2::new(800, 800),
128                offset: Vec2::ZERO,
129                size: UVec2::new(800, 400),
130            }),
131            order: 3,
132            ..default()
133        },
134        ExampleViewports::PerspectiveControl,
135        transform,
136    ));
137
138    // Main orthographic camera:
139    //
140    // The main orthographic image to use as a comparison for the sub views.
141    commands.spawn((
142        Camera3d::default(),
143        Projection::from(OrthographicProjection {
144            scaling_mode: ScalingMode::FixedVertical {
145                viewport_height: 6.0,
146            },
147            ..OrthographicProjection::default_3d()
148        }),
149        Camera {
150            order: 4,
151            ..default()
152        },
153        ExampleViewports::OrthographicMain,
154        transform,
155    ));
156
157    // Orthographic camera left half:
158    //
159    // For this camera, the projection is orthographic, and `size` is half the
160    // width of the `full_size`, causing the left half of the image to be shown.
161    // Since the viewport has an aspect ratio of 1x1 and the sub view has an
162    // aspect ratio of 1x2, the image appears stretched along the horizontal axis.
163    commands.spawn((
164        Camera3d::default(),
165        Projection::from(OrthographicProjection {
166            scaling_mode: ScalingMode::FixedVertical {
167                viewport_height: 6.0,
168            },
169            ..OrthographicProjection::default_3d()
170        }),
171        Camera {
172            sub_camera_view: Some(SubCameraView {
173                full_size: UVec2::new(2, 2),
174                offset: Vec2::ZERO,
175                size: UVec2::new(1, 2),
176            }),
177            order: 5,
178            ..default()
179        },
180        ExampleViewports::OrthographicStretched,
181        transform,
182    ));
183
184    // Orthographic camera moving:
185    //
186    // For this camera, the projection is orthographic, and the offset is
187    // updated continuously in 150 units per second in `move_camera_view`. Since
188    // the `full_size` is 500x500, the image should appear to be moving across
189    // the full image once every 3.3 seconds. `size` is a fifth of the size of
190    // `full_size`, so the image will appear zoomed in.
191    commands.spawn((
192        Camera3d::default(),
193        Projection::from(OrthographicProjection {
194            scaling_mode: ScalingMode::FixedVertical {
195                viewport_height: 6.0,
196            },
197            ..OrthographicProjection::default_3d()
198        }),
199        Camera {
200            sub_camera_view: Some(SubCameraView {
201                full_size: UVec2::new(500, 500),
202                offset: Vec2::ZERO,
203                size: UVec2::new(100, 100),
204            }),
205            order: 6,
206            ..default()
207        },
208        transform,
209        ExampleViewports::OrthographicMoving,
210        MovingCameraMarker,
211    ));
212
213    // Orthographic camera different aspect ratio:
214    //
215    // For this camera, the projection is orthographic, and the aspect ratio of
216    // the sub view (2x1) is different to the aspect ratio of the full view
217    // (2x2). The aspect ratio of the sub view matches the aspect ratio of
218    // the viewport and should show an unstretched image of the top half of the
219    // full orthographic image.
220    commands.spawn((
221        Camera3d::default(),
222        Projection::from(OrthographicProjection {
223            scaling_mode: ScalingMode::FixedVertical {
224                viewport_height: 6.0,
225            },
226            ..OrthographicProjection::default_3d()
227        }),
228        Camera {
229            sub_camera_view: Some(SubCameraView {
230                full_size: UVec2::new(200, 200),
231                offset: Vec2::ZERO,
232                size: UVec2::new(200, 100),
233            }),
234            order: 7,
235            ..default()
236        },
237        ExampleViewports::OrthographicControl,
238        transform,
239    ));
240}

Trait Implementations§

Source§

impl CameraProjection for OrthographicProjection

Source§

fn get_clip_from_view(&self) -> Mat4

Generate the projection matrix.
Source§

fn get_clip_from_view_for_sub(&self, sub_view: &SubCameraView) -> Mat4

Generate the projection matrix for a SubCameraView.
Source§

fn update(&mut self, width: f32, height: f32)

When the area this camera renders to changes dimensions, this method will be automatically called. Use this to update any projection properties that depend on the aspect ratio or dimensions of the render area.
Source§

fn far(&self) -> f32

The far plane distance of the projection.
Source§

fn get_frustum_corners(&self, z_near: f32, z_far: f32) -> [Vec3A; 8]

The eight corners of the camera frustum, as defined by this projection. Read more
Source§

fn compute_frustum(&self, camera_transform: &GlobalTransform) -> Frustum

Compute camera frustum for camera with given projection and transform. Read more
Source§

impl Clone for OrthographicProjection

Source§

fn clone(&self) -> OrthographicProjection

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 Debug for OrthographicProjection

Source§

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

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

impl From<OrthographicProjection> for Projection

Source§

fn from(value: OrthographicProjection) -> Projection

Converts to this type from the input type.
Source§

impl FromArg for &'static OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

type This<'from_arg> = &'from_arg OrthographicProjection

The type to convert into. Read more
Source§

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

Creates an item from an argument. Read more
Source§

impl FromArg for &'static mut OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

type This<'from_arg> = &'from_arg mut OrthographicProjection

The type to convert into. Read more
Source§

fn from_arg( arg: Arg<'_>, ) -> Result<<&'static mut OrthographicProjection as FromArg>::This<'_>, ArgError>

Creates an item from an argument. Read more
Source§

impl FromArg for OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

type This<'from_arg> = OrthographicProjection

The type to convert into. Read more
Source§

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

Creates an item from an argument. Read more
Source§

impl FromReflect for OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

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

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 FromWorld for OrthographicProjection

Source§

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

Creates Self using data from the given World.
Source§

impl GetOwnership for &OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl GetOwnership for &mut OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl GetOwnership for OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl GetTypeRegistration for OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

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 &OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

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

Converts Self into a Return value.
Source§

impl IntoReturn for &mut OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

fn into_return<'into_return>(self) -> Return<'into_return>
where &mut OrthographicProjection: 'into_return,

Converts Self into a Return value.
Source§

impl IntoReturn for OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

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

Converts Self into a Return value.
Source§

impl PartialReflect for OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

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<OrthographicProjection>) -> ReflectOwned

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

fn try_into_reflect( self: Box<OrthographicProjection>, ) -> 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<OrthographicProjection>, ) -> 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 clone_value(&self) -> Box<dyn PartialReflect>

👎Deprecated since 0.16.0: to clone reflected values, prefer using reflect_clone. To convert reflected values to dynamic ones, use to_dynamic.
Clones Self into its dynamic representation. 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_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 OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

fn into_any(self: Box<OrthographicProjection>) -> 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<OrthographicProjection>) -> 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 OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

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

Source§

fn clone_dynamic(&self) -> DynamicStruct

👎Deprecated since 0.16.0: use to_dynamic_struct instead
Clones the struct into a DynamicStruct.
Source§

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

Will return None if TypeInfo is not available.
Source§

impl TypePath for OrthographicProjection

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 OrthographicProjection
where OrthographicProjection: Any + Send + Sync, f32: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Vec2: FromReflect + TypePath + MaybeTyped + RegisterForReflection, ScalingMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection, Rect: FromReflect + TypePath + MaybeTyped + RegisterForReflection,

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.

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<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 + Sync + Send>

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