Skip to main content

UVec2

Struct UVec2 

Source
#[repr(C)]
pub struct UVec2 { pub x: u32, pub y: u32, }
Expand description

A 2-dimensional vector.

Fields§

§x: u32§y: u32

Implementations§

Source§

impl UVec2

Source

pub const ZERO: UVec2

All zeroes.

Source

pub const ONE: UVec2

All ones.

Source

pub const MIN: UVec2

All u32::MIN.

Source

pub const MAX: UVec2

All u32::MAX.

Source

pub const X: UVec2

A unit vector pointing along the positive X axis.

Source

pub const Y: UVec2

A unit vector pointing along the positive Y axis.

Source

pub const AXES: [UVec2; 2]

The unit axes.

Source

pub const fn new(x: u32, y: u32) -> UVec2

Creates a new vector.

Examples found in repository?
examples/shader/compute_shader_game_of_life.rs (line 29)
29const SIZE: UVec2 = UVec2::new(1280 / DISPLAY_FACTOR, 720 / DISPLAY_FACTOR);
More examples
Hide additional examples
examples/window/persisting_window_settings.rs (lines 121-124)
115fn store_window_settings(mut window_settings: ResMut<WindowSettings>, window: &Window) -> bool {
116    window_settings.set_if_neq(WindowSettings {
117        position: match window.position {
118            WindowPosition::At(pos) => Some(pos),
119            _ => None,
120        },
121        size: Some(UVec2::new(
122            window.resolution.width() as u32,
123            window.resolution.height() as u32,
124        )),
125        fullscreen: window.mode != WindowMode::Windowed,
126    })
127}
examples/window/custom_cursor_image.rs (line 201)
195    const SECTIONS: [Option<URect>; 5] = [
196        Some(URect {
197            min: UVec2::ZERO,
198            max: UVec2::splat(RECT_SIZE),
199        }),
200        Some(URect {
201            min: UVec2::new(RECT_SIZE, 0),
202            max: UVec2::new(2 * RECT_SIZE, RECT_SIZE),
203        }),
204        Some(URect {
205            min: UVec2::new(0, RECT_SIZE),
206            max: UVec2::new(RECT_SIZE, 2 * RECT_SIZE),
207        }),
208        Some(URect {
209            min: UVec2::new(RECT_SIZE, RECT_SIZE),
210            max: UVec2::splat(2 * RECT_SIZE),
211        }),
212        None, // reset to None
213    ];
examples/2d/tilemap_chunk.rs (line 76)
70fn spawn_fake_player(
71    mut commands: Commands,
72    mut meshes: ResMut<Assets<Mesh>>,
73    mut materials: ResMut<Assets<ColorMaterial>>,
74    chunk: Single<&TilemapChunk>,
75) {
76    let mut transform = chunk.calculate_tile_transform(UVec2::new(0, 0));
77    transform.translation.z = 1.;
78
79    commands.spawn((
80        Mesh2d(meshes.add(Rectangle::new(8., 8.))),
81        MeshMaterial2d(materials.add(Color::from(RED_400))),
82        transform,
83        MovePlayer,
84    ));
85
86    let mut transform = chunk.calculate_tile_transform(UVec2::new(5, 6));
87    transform.translation.z = 1.;
88
89    // second "player" to visually test a non-zero position
90    commands.spawn((
91        Mesh2d(meshes.add(Rectangle::new(8., 8.))),
92        MeshMaterial2d(materials.add(Color::from(RED_400))),
93        transform,
94    ));
95}
96
97fn move_player(
98    mut player: Single<&mut Transform, With<MovePlayer>>,
99    time: Res<Time>,
100    chunk: Single<&TilemapChunk>,
101) {
102    let t = (ops::sin(time.elapsed_secs()) + 1.) / 2.;
103
104    let origin = chunk
105        .calculate_tile_transform(UVec2::new(0, 0))
106        .translation
107        .x;
108    let destination = chunk
109        .calculate_tile_transform(UVec2::new(63, 0))
110        .translation
111        .x;
112
113    player.translation.x = origin.lerp(destination, t);
114}
115
116fn update_tilemap(
117    time: Res<Time>,
118    mut query: Query<(&mut TilemapChunkTileData, &mut UpdateTimer)>,
119    mut rng: ResMut<SeededRng>,
120) {
121    for (mut tile_data, mut timer) in query.iter_mut() {
122        timer.tick(time.delta());
123
124        if timer.just_finished() {
125            for _ in 0..50 {
126                let index = rng.random_range(0..tile_data.len());
127                tile_data[index] = Some(TileData::from_tileset_index(rng.random_range(0..5)));
128            }
129        }
130    }
131}
132
133// find the data for an arbitrary tile in the chunk and log its data
134fn log_tile(tilemap: Single<(&TilemapChunk, &TilemapChunkTileData)>, mut local: Local<u16>) {
135    let (chunk, data) = tilemap.into_inner();
136    let Some(tile_data) = data.tile_data_from_tile_pos(chunk.chunk_size, UVec2::new(3, 4)) else {
137        return;
138    };
139    // log when the tile changes
140    if tile_data.tileset_index != *local {
141        info!(?tile_data, "tile_data changed");
142        *local = tile_data.tileset_index;
143    }
144}
examples/testbed/2d.rs (line 422)
394    pub fn draw_gizmos(mut gizmos: Gizmos) {
395        gizmos.rect_2d(
396            Isometry2d::from_translation(Vec2::new(-200.0, 0.0)),
397            Vec2::new(200.0, 200.0),
398            RED,
399        );
400        gizmos
401            .circle_2d(
402                Isometry2d::from_translation(Vec2::new(-200.0, 0.0)),
403                200.0,
404                GREEN,
405            )
406            .resolution(64);
407
408        gizmos.text_2d(
409            Isometry2d::from_translation(Vec2::new(-200.0, 0.0)),
410            "text_2d gizmo",
411            15.,
412            Vec2 { x: 0., y: 0. },
413            Color::WHITE,
414        );
415
416        // 2d grids with all variations of outer edges on or off
417        for i in 0..4 {
418            let x = 200.0 * (1.0 + (i % 2) as f32);
419            let y = 150.0 * (0.5 - (i / 2) as f32);
420            let mut grid = gizmos.grid(
421                Vec3::new(x, y, 0.0),
422                UVec2::new(5, 4),
423                Vec2::splat(30.),
424                Color::WHITE,
425            );
426            if i & 1 > 0 {
427                grid = grid.outer_edges_x();
428            }
429            if i & 2 > 0 {
430                grid.outer_edges_y();
431            }
432        }
433    }
examples/picking/sprite_picking.rs (line 128)
122fn setup_atlas(
123    mut commands: Commands,
124    asset_server: Res<AssetServer>,
125    mut texture_atlas_layouts: ResMut<Assets<TextureAtlasLayout>>,
126) {
127    let texture_handle = asset_server.load("textures/rpg/chars/gabe/gabe-idle-run.png");
128    let layout = TextureAtlasLayout::from_grid(UVec2::new(24, 24), 7, 1, None, None);
129    let texture_atlas_layout_handle = texture_atlas_layouts.add(layout);
130    // Use only the subset of sprites in the sheet that make up the run animation
131    let animation_indices = AnimationIndices { first: 1, last: 6 };
132    commands
133        .spawn((
134            Sprite::from_atlas_image(
135                texture_handle,
136                TextureAtlas {
137                    layout: texture_atlas_layout_handle,
138                    index: animation_indices.first,
139                },
140            ),
141            Transform::from_xyz(300.0, 0.0, 0.0).with_scale(Vec3::splat(6.0)),
142            animation_indices,
143            AnimationTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
144            Pickable::default(),
145        ))
146        .observe(recolor_on::<Pointer<Over>>(Color::srgb(0.0, 1.0, 1.0)))
147        .observe(recolor_on::<Pointer<Out>>(Color::srgb(1.0, 1.0, 1.0)))
148        .observe(recolor_on::<Pointer<Press>>(Color::srgb(1.0, 1.0, 0.0)))
149        .observe(recolor_on::<Pointer<Release>>(Color::srgb(0.0, 1.0, 1.0)));
150}
Source

pub const fn splat(v: u32) -> UVec2

Creates a vector with all elements set to v.

Examples found in repository?
examples/testbed/2d.rs (line 445)
445    const ATLAS_SIZE: UVec2 = UVec2::splat(64);
446    const IMAGE_SIZE: UVec2 = UVec2::splat(28);
447    const PADDING_SIZE: UVec2 = UVec2::splat(2);
More examples
Hide additional examples
examples/2d/dynamic_mip_generation.rs (line 412)
406    fn next(&mut self) -> Option<Self::Item> {
407        // The size of mipmap level N + 1 is equal to half the size of mipmap
408        // level N, rounding down, except that the size can never go below 1
409        // pixel on either axis.
410        let result = self.size;
411        if let Some(size) = self.size {
412            self.size = if size == UVec2::splat(1) {
413                None
414            } else {
415                Some((size / 2).max(UVec2::splat(1)))
416            };
417        }
418        result
419    }
examples/2d/sprite_sheet.rs (line 48)
42fn setup(
43    mut commands: Commands,
44    asset_server: Res<AssetServer>,
45    mut texture_atlas_layouts: ResMut<Assets<TextureAtlasLayout>>,
46) {
47    let texture = asset_server.load("textures/rpg/chars/gabe/gabe-idle-run.png");
48    let layout = TextureAtlasLayout::from_grid(UVec2::splat(24), 7, 1, None, None);
49    let texture_atlas_layout = texture_atlas_layouts.add(layout);
50    // Use only the subset of sprites in the sheet that make up the run animation
51    let animation_indices = AnimationIndices { first: 1, last: 6 };
52
53    commands.spawn(Camera2d);
54
55    commands.spawn((
56        Sprite::from_atlas_image(
57            texture,
58            TextureAtlas {
59                layout: texture_atlas_layout,
60                index: animation_indices.first,
61            },
62        ),
63        Transform::from_scale(Vec3::splat(6.0)),
64        animation_indices,
65        AnimationTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
66    ));
67}
examples/shader_advanced/render_depth_to_texture.rs (line 255)
240fn spawn_depth_only_camera(commands: &mut Commands) {
241    commands.spawn((
242        Camera3d::default(),
243        Transform::from_xyz(-4.0, -5.0, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
244        Camera {
245            // Make sure that we render from this depth-only camera *before*
246            // rendering from the main camera.
247            order: -1,
248            ..Camera::default()
249        },
250        // We specify no color render target, for maximum efficiency.
251        RenderTarget::None {
252            // When specifying no render target, we must manually specify
253            // the viewport size. Otherwise, Bevy won't know how big to make
254            // the depth buffer.
255            size: UVec2::splat(DEPTH_TEXTURE_SIZE),
256        },
257        // We need to disable multisampling or the depth texture will be
258        // multisampled, which adds complexity we don't care about for this
259        // demo.
260        Msaa::Off,
261        // Cameras with no render target render *nothing* by default. To get
262        // them to render something, we must add a prepass that specifies what
263        // we want to render: in this case, depth.
264        DepthPrepass,
265    ));
266}
examples/window/custom_cursor_image.rs (line 38)
31fn setup_cursor_icon(
32    mut commands: Commands,
33    asset_server: Res<AssetServer>,
34    mut texture_atlas_layouts: ResMut<Assets<TextureAtlasLayout>>,
35    window: Single<Entity, With<Window>>,
36) {
37    let layout =
38        TextureAtlasLayout::from_grid(UVec2::splat(64), 20, 10, Some(UVec2::splat(5)), None);
39    let texture_atlas_layout = texture_atlas_layouts.add(layout);
40
41    let animation_config = AnimationConfig::new(0, 199, 1, 4);
42
43    commands.entity(*window).insert((
44        CursorIcon::Custom(CustomCursor::Image(CustomCursorImage {
45            // Image to use as the cursor.
46            handle: asset_server
47                .load("cursors/kenney_crosshairPack/Tilesheet/crosshairs_tilesheet_white.png"),
48            // Optional texture atlas allows you to pick a section of the image
49            // and animate it.
50            texture_atlas: Some(TextureAtlas {
51                layout: texture_atlas_layout.clone(),
52                index: animation_config.first_sprite_index,
53            }),
54            flip_x: false,
55            flip_y: false,
56            // Optional section of the image to use as the cursor.
57            rect: None,
58            // The hotspot is the point in the cursor image that will be
59            // positioned at the mouse cursor's position.
60            hotspot: (0, 0),
61        })),
62        animation_config,
63    ));
64}
65
66fn setup_camera(mut commands: Commands) {
67    commands.spawn(Camera3d::default());
68}
69
70fn setup_instructions(mut commands: Commands) {
71    commands.spawn((
72        Text::new(
73            "Press T to toggle the cursor's `texture_atlas`.\n
74Press X to toggle the cursor's `flip_x` setting.\n
75Press Y to toggle the cursor's `flip_y` setting.\n
76Press C to cycle through the sections of the cursor's image using `rect`.",
77        ),
78        Node {
79            position_type: PositionType::Absolute,
80            bottom: px(12),
81            left: px(12),
82            ..default()
83        },
84    ));
85}
86
87#[derive(Component)]
88struct AnimationConfig {
89    first_sprite_index: usize,
90    last_sprite_index: usize,
91    increment: usize,
92    fps: u8,
93    frame_timer: Timer,
94}
95
96impl AnimationConfig {
97    fn new(first: usize, last: usize, increment: usize, fps: u8) -> Self {
98        Self {
99            first_sprite_index: first,
100            last_sprite_index: last,
101            increment,
102            fps,
103            frame_timer: Self::timer_from_fps(fps),
104        }
105    }
106
107    fn timer_from_fps(fps: u8) -> Timer {
108        Timer::new(Duration::from_secs_f32(1.0 / (fps as f32)), TimerMode::Once)
109    }
110}
111
112/// This system loops through all the sprites in the [`CursorIcon`]'s
113/// [`TextureAtlas`], from [`AnimationConfig`]'s `first_sprite_index` to
114/// `last_sprite_index`.
115fn execute_animation(time: Res<Time>, mut query: Query<(&mut AnimationConfig, &mut CursorIcon)>) {
116    for (mut config, mut cursor_icon) in &mut query {
117        if let CursorIcon::Custom(CustomCursor::Image(ref mut image)) = *cursor_icon {
118            config.frame_timer.tick(time.delta());
119
120            if config.frame_timer.is_finished()
121                && let Some(atlas) = image.texture_atlas.as_mut()
122            {
123                atlas.index += config.increment;
124
125                if atlas.index > config.last_sprite_index {
126                    atlas.index = config.first_sprite_index;
127                }
128
129                config.frame_timer = AnimationConfig::timer_from_fps(config.fps);
130            }
131        }
132    }
133}
134
135fn toggle_texture_atlas(
136    input: Res<ButtonInput<KeyCode>>,
137    mut query: Query<&mut CursorIcon, With<Window>>,
138    mut cached_atlas: Local<Option<TextureAtlas>>, // this lets us restore the previous value
139) {
140    if input.just_pressed(KeyCode::KeyT) {
141        for mut cursor_icon in &mut query {
142            if let CursorIcon::Custom(CustomCursor::Image(ref mut image)) = *cursor_icon {
143                match image.texture_atlas.take() {
144                    Some(a) => {
145                        // Save the current texture atlas.
146                        *cached_atlas = Some(a.clone());
147                    }
148                    None => {
149                        // Restore the cached texture atlas.
150                        if let Some(cached_a) = cached_atlas.take() {
151                            image.texture_atlas = Some(cached_a);
152                        }
153                    }
154                }
155            }
156        }
157    }
158}
159
160fn toggle_flip_x(
161    input: Res<ButtonInput<KeyCode>>,
162    mut query: Query<&mut CursorIcon, With<Window>>,
163) {
164    if input.just_pressed(KeyCode::KeyX) {
165        for mut cursor_icon in &mut query {
166            if let CursorIcon::Custom(CustomCursor::Image(ref mut image)) = *cursor_icon {
167                image.flip_x = !image.flip_x;
168            }
169        }
170    }
171}
172
173fn toggle_flip_y(
174    input: Res<ButtonInput<KeyCode>>,
175    mut query: Query<&mut CursorIcon, With<Window>>,
176) {
177    if input.just_pressed(KeyCode::KeyY) {
178        for mut cursor_icon in &mut query {
179            if let CursorIcon::Custom(CustomCursor::Image(ref mut image)) = *cursor_icon {
180                image.flip_y = !image.flip_y;
181            }
182        }
183    }
184}
185
186/// This system alternates the [`CursorIcon`]'s `rect` field between `None` and
187/// 4 sections/rectangles of the cursor's image.
188fn cycle_rect(input: Res<ButtonInput<KeyCode>>, mut query: Query<&mut CursorIcon, With<Window>>) {
189    if !input.just_pressed(KeyCode::KeyC) {
190        return;
191    }
192
193    const RECT_SIZE: u32 = 32; // half the size of a tile in the texture atlas
194
195    const SECTIONS: [Option<URect>; 5] = [
196        Some(URect {
197            min: UVec2::ZERO,
198            max: UVec2::splat(RECT_SIZE),
199        }),
200        Some(URect {
201            min: UVec2::new(RECT_SIZE, 0),
202            max: UVec2::new(2 * RECT_SIZE, RECT_SIZE),
203        }),
204        Some(URect {
205            min: UVec2::new(0, RECT_SIZE),
206            max: UVec2::new(RECT_SIZE, 2 * RECT_SIZE),
207        }),
208        Some(URect {
209            min: UVec2::new(RECT_SIZE, RECT_SIZE),
210            max: UVec2::splat(2 * RECT_SIZE),
211        }),
212        None, // reset to None
213    ];
examples/2d/tilemap_chunk.rs (line 31)
26fn setup(mut commands: Commands, assets: Res<AssetServer>) {
27    // We're seeding the PRNG here to make this example deterministic for testing purposes.
28    // This isn't strictly required in practical use unless you need your app to be deterministic.
29    let mut rng = ChaCha8Rng::seed_from_u64(42);
30
31    let chunk_size = UVec2::splat(64);
32    let tile_display_size = UVec2::splat(8);
33    let tile_data: Vec<Option<TileData>> = (0..chunk_size.element_product())
34        .map(|_| rng.random_range(0..5))
35        .map(|i| {
36            if i == 0 {
37                None
38            } else {
39                Some(TileData::from_tileset_index(i - 1))
40            }
41        })
42        .collect();
43
44    commands.spawn((
45        TilemapChunk {
46            chunk_size,
47            tile_display_size,
48            tileset: assets
49                .load_builder()
50                .with_settings(|settings: &mut ImageLoaderSettings| {
51                    // The tileset texture is expected to be an array of tile textures, so we tell the
52                    // `ImageLoader` that our texture is composed of 4 stacked tile images.
53                    settings.array_layout = Some(ImageArrayLayout::RowCount { rows: 4 });
54                })
55                .load("textures/array_texture.png"),
56            ..default()
57        },
58        TilemapChunkTileData(tile_data),
59        UpdateTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
60    ));
61
62    commands.spawn(Camera2d);
63
64    commands.insert_resource(SeededRng(rng));
65}
Source

pub fn map<F>(self, f: F) -> UVec2
where F: Fn(u32) -> u32,

Returns a vector containing each element of self modified by a mapping function f.

Source

pub fn select(mask: BVec2, if_true: UVec2, if_false: UVec2) -> UVec2

Creates a vector from the elements in if_true and if_false, selecting which to use for each element of self.

A true element in the mask uses the corresponding element from if_true, and false uses the element from if_false.

Source

pub const fn from_array(a: [u32; 2]) -> UVec2

Creates a new vector from an array.

Source

pub const fn to_array(&self) -> [u32; 2]

Converts self to [x, y]

Source

pub const fn from_slice(slice: &[u32]) -> UVec2

Creates a vector from the first 2 values in slice.

§Panics

Panics if slice is less than 2 elements long.

Source

pub fn write_to_slice(self, slice: &mut [u32])

Writes the elements of self to the first 2 elements in slice.

§Panics

Panics if slice is less than 2 elements long.

Source

pub const fn extend(self, z: u32) -> UVec3

Creates a 3D vector from self and the given z value.

Source

pub fn with_x(self, x: u32) -> UVec2

Creates a 2D vector from self with the given value of x.

Source

pub fn with_y(self, y: u32) -> UVec2

Creates a 2D vector from self with the given value of y.

Source

pub fn dot(self, rhs: UVec2) -> u32

Computes the dot product of self and rhs.

Source

pub fn dot_into_vec(self, rhs: UVec2) -> UVec2

Returns a vector where every component is the dot product of self and rhs.

Source

pub fn min(self, rhs: UVec2) -> UVec2

Returns a vector containing the minimum values for each element of self and rhs.

In other words this computes [min(x, rhs.x), min(self.y, rhs.y), ..].

Examples found in repository?
examples/2d/2d_viewport_to_world.rs (line 102)
42fn controls(
43    camera_query: Single<(&mut Camera, &mut Transform, &mut Projection)>,
44    window: Single<&Window>,
45    input: Res<ButtonInput<KeyCode>>,
46    time: Res<Time<Fixed>>,
47) {
48    let (mut camera, mut transform, mut projection) = camera_query.into_inner();
49
50    let fspeed = 600.0 * time.delta_secs();
51    let uspeed = fspeed as u32;
52    let window_size = window.resolution.physical_size();
53
54    // Camera movement controls
55    if input.pressed(KeyCode::ArrowUp) {
56        transform.translation.y += fspeed;
57    }
58    if input.pressed(KeyCode::ArrowDown) {
59        transform.translation.y -= fspeed;
60    }
61    if input.pressed(KeyCode::ArrowLeft) {
62        transform.translation.x -= fspeed;
63    }
64    if input.pressed(KeyCode::ArrowRight) {
65        transform.translation.x += fspeed;
66    }
67
68    // Camera zoom controls
69    if let Projection::Orthographic(projection2d) = &mut *projection {
70        if input.pressed(KeyCode::Comma) {
71            projection2d.scale *= powf(4.0f32, time.delta_secs());
72        }
73
74        if input.pressed(KeyCode::Period) {
75            projection2d.scale *= powf(0.25f32, time.delta_secs());
76        }
77    }
78
79    if let Some(viewport) = camera.viewport.as_mut() {
80        // Reset viewport size on window resize
81        if viewport.physical_size.x > window_size.x || viewport.physical_size.y > window_size.y {
82            viewport.physical_size = (window_size.as_vec2() * 0.75).as_uvec2();
83        }
84
85        // Viewport movement controls
86        if input.pressed(KeyCode::KeyW) {
87            viewport.physical_position.y = viewport.physical_position.y.saturating_sub(uspeed);
88        }
89        if input.pressed(KeyCode::KeyS) {
90            viewport.physical_position.y += uspeed;
91        }
92        if input.pressed(KeyCode::KeyA) {
93            viewport.physical_position.x = viewport.physical_position.x.saturating_sub(uspeed);
94        }
95        if input.pressed(KeyCode::KeyD) {
96            viewport.physical_position.x += uspeed;
97        }
98
99        // Bound viewport position so it doesn't go off-screen
100        viewport.physical_position = viewport
101            .physical_position
102            .min(window_size - viewport.physical_size);
103
104        // Viewport size controls
105        if input.pressed(KeyCode::KeyI) {
106            viewport.physical_size.y = viewport.physical_size.y.saturating_sub(uspeed);
107        }
108        if input.pressed(KeyCode::KeyK) {
109            viewport.physical_size.y += uspeed;
110        }
111        if input.pressed(KeyCode::KeyJ) {
112            viewport.physical_size.x = viewport.physical_size.x.saturating_sub(uspeed);
113        }
114        if input.pressed(KeyCode::KeyL) {
115            viewport.physical_size.x += uspeed;
116        }
117
118        // Bound viewport size so it doesn't go off-screen
119        viewport.physical_size = viewport
120            .physical_size
121            .min(window_size - viewport.physical_position)
122            .max(UVec2::new(20, 20));
123    }
124}
Source

pub fn max(self, rhs: UVec2) -> UVec2

Returns a vector containing the maximum values for each element of self and rhs.

In other words this computes [max(self.x, rhs.x), max(self.y, rhs.y), ..].

Examples found in repository?
examples/2d/dynamic_mip_generation.rs (line 415)
406    fn next(&mut self) -> Option<Self::Item> {
407        // The size of mipmap level N + 1 is equal to half the size of mipmap
408        // level N, rounding down, except that the size can never go below 1
409        // pixel on either axis.
410        let result = self.size;
411        if let Some(size) = self.size {
412            self.size = if size == UVec2::splat(1) {
413                None
414            } else {
415                Some((size / 2).max(UVec2::splat(1)))
416            };
417        }
418        result
419    }
More examples
Hide additional examples
examples/2d/2d_viewport_to_world.rs (line 122)
42fn controls(
43    camera_query: Single<(&mut Camera, &mut Transform, &mut Projection)>,
44    window: Single<&Window>,
45    input: Res<ButtonInput<KeyCode>>,
46    time: Res<Time<Fixed>>,
47) {
48    let (mut camera, mut transform, mut projection) = camera_query.into_inner();
49
50    let fspeed = 600.0 * time.delta_secs();
51    let uspeed = fspeed as u32;
52    let window_size = window.resolution.physical_size();
53
54    // Camera movement controls
55    if input.pressed(KeyCode::ArrowUp) {
56        transform.translation.y += fspeed;
57    }
58    if input.pressed(KeyCode::ArrowDown) {
59        transform.translation.y -= fspeed;
60    }
61    if input.pressed(KeyCode::ArrowLeft) {
62        transform.translation.x -= fspeed;
63    }
64    if input.pressed(KeyCode::ArrowRight) {
65        transform.translation.x += fspeed;
66    }
67
68    // Camera zoom controls
69    if let Projection::Orthographic(projection2d) = &mut *projection {
70        if input.pressed(KeyCode::Comma) {
71            projection2d.scale *= powf(4.0f32, time.delta_secs());
72        }
73
74        if input.pressed(KeyCode::Period) {
75            projection2d.scale *= powf(0.25f32, time.delta_secs());
76        }
77    }
78
79    if let Some(viewport) = camera.viewport.as_mut() {
80        // Reset viewport size on window resize
81        if viewport.physical_size.x > window_size.x || viewport.physical_size.y > window_size.y {
82            viewport.physical_size = (window_size.as_vec2() * 0.75).as_uvec2();
83        }
84
85        // Viewport movement controls
86        if input.pressed(KeyCode::KeyW) {
87            viewport.physical_position.y = viewport.physical_position.y.saturating_sub(uspeed);
88        }
89        if input.pressed(KeyCode::KeyS) {
90            viewport.physical_position.y += uspeed;
91        }
92        if input.pressed(KeyCode::KeyA) {
93            viewport.physical_position.x = viewport.physical_position.x.saturating_sub(uspeed);
94        }
95        if input.pressed(KeyCode::KeyD) {
96            viewport.physical_position.x += uspeed;
97        }
98
99        // Bound viewport position so it doesn't go off-screen
100        viewport.physical_position = viewport
101            .physical_position
102            .min(window_size - viewport.physical_size);
103
104        // Viewport size controls
105        if input.pressed(KeyCode::KeyI) {
106            viewport.physical_size.y = viewport.physical_size.y.saturating_sub(uspeed);
107        }
108        if input.pressed(KeyCode::KeyK) {
109            viewport.physical_size.y += uspeed;
110        }
111        if input.pressed(KeyCode::KeyJ) {
112            viewport.physical_size.x = viewport.physical_size.x.saturating_sub(uspeed);
113        }
114        if input.pressed(KeyCode::KeyL) {
115            viewport.physical_size.x += uspeed;
116        }
117
118        // Bound viewport size so it doesn't go off-screen
119        viewport.physical_size = viewport
120            .physical_size
121            .min(window_size - viewport.physical_position)
122            .max(UVec2::new(20, 20));
123    }
124}
Source

pub fn clamp(self, min: UVec2, max: UVec2) -> UVec2

Component-wise clamping of values, similar to u32::clamp.

Each element in min must be less-or-equal to the corresponding element in max.

§Panics

Will panic if min is greater than max when glam_assert is enabled.

Source

pub fn min_element(self) -> u32

Returns the horizontal minimum of self.

In other words this computes min(x, y, ..).

Source

pub fn max_element(self) -> u32

Returns the horizontal maximum of self.

In other words this computes max(x, y, ..).

Source

pub fn min_position(self) -> usize

Returns the index of the first minimum element of self.

Source

pub fn max_position(self) -> usize

Returns the index of the first maximum element of self.

Source

pub fn element_sum(self) -> u32

Returns the sum of all elements of self.

In other words, this computes self.x + self.y + ...

Source

pub fn element_product(self) -> u32

Returns the product of all elements of self.

In other words, this computes self.x * self.y * ...

Examples found in repository?
examples/2d/tilemap_chunk.rs (line 33)
26fn setup(mut commands: Commands, assets: Res<AssetServer>) {
27    // We're seeding the PRNG here to make this example deterministic for testing purposes.
28    // This isn't strictly required in practical use unless you need your app to be deterministic.
29    let mut rng = ChaCha8Rng::seed_from_u64(42);
30
31    let chunk_size = UVec2::splat(64);
32    let tile_display_size = UVec2::splat(8);
33    let tile_data: Vec<Option<TileData>> = (0..chunk_size.element_product())
34        .map(|_| rng.random_range(0..5))
35        .map(|i| {
36            if i == 0 {
37                None
38            } else {
39                Some(TileData::from_tileset_index(i - 1))
40            }
41        })
42        .collect();
43
44    commands.spawn((
45        TilemapChunk {
46            chunk_size,
47            tile_display_size,
48            tileset: assets
49                .load_builder()
50                .with_settings(|settings: &mut ImageLoaderSettings| {
51                    // The tileset texture is expected to be an array of tile textures, so we tell the
52                    // `ImageLoader` that our texture is composed of 4 stacked tile images.
53                    settings.array_layout = Some(ImageArrayLayout::RowCount { rows: 4 });
54                })
55                .load("textures/array_texture.png"),
56            ..default()
57        },
58        TilemapChunkTileData(tile_data),
59        UpdateTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
60    ));
61
62    commands.spawn(Camera2d);
63
64    commands.insert_resource(SeededRng(rng));
65}
More examples
Hide additional examples
examples/2d/tilemap_chunk_orientation.rs (line 45)
17fn setup(mut commands: Commands, assets: Res<AssetServer>) {
18    let chunk_size = UVec2::splat(8);
19    let tile_display_size = UVec2::splat(64);
20
21    // We'll use each possible orientation, one per column
22    let orientation = [
23        TileOrientation::Default,
24        TileOrientation::Rotate90,
25        TileOrientation::Rotate180,
26        TileOrientation::Rotate270,
27        TileOrientation::MirrorH,
28        TileOrientation::MirrorHRotate90,
29        TileOrientation::MirrorHRotate180,
30        TileOrientation::MirrorHRotate270,
31    ];
32
33    // Show different color/alpha on each row
34    let colors = [
35        Color::WHITE,
36        Color::linear_rgb(1.0, 0.0, 0.0),
37        Color::linear_rgb(0.0, 1.0, 0.0),
38        Color::linear_rgb(0.0, 0.0, 1.0),
39        Color::linear_rgba(1.0, 0.0, 0.0, 0.25),
40        Color::linear_rgba(0.0, 1.0, 0.0, 0.25),
41        Color::linear_rgba(0.0, 0.0, 1.0, 0.25),
42        Color::linear_rgba(1.0, 1.0, 1.0, 0.5),
43    ];
44
45    let tile_data = (0..chunk_size.element_product())
46        .map(|i| {
47            let row = i / 8;
48            let col = i % 8;
49            Some(TileData {
50                // Alternate tiles per row
51                tileset_index: (row % 2) as u16,
52                color: colors[row as usize],
53                // Last (top) row is invisible
54                visible: row != 7,
55                orientation: orientation[col as usize],
56            })
57        })
58        .collect();
59
60    commands.spawn((
61        TilemapChunk {
62            chunk_size,
63            tile_display_size,
64            tileset: assets
65                .load_builder()
66                .with_settings(|settings: &mut ImageLoaderSettings| {
67                    // The tileset texture is expected to be an array of tile textures, so we tell the
68                    // `ImageLoader` that our texture is composed of 2 stacked tile images.
69                    settings.array_layout = Some(ImageArrayLayout::RowCount { rows: 2 });
70                })
71                .load("textures/arrow.png"),
72            alpha_mode: AlphaMode2d::Blend,
73        },
74        TilemapChunkTileData(tile_data),
75    ));
76
77    commands.spawn(Camera2d);
78}
Source

pub fn cmpeq(self, rhs: UVec2) -> BVec2

Returns a vector mask containing the result of a == comparison for each element of self and rhs.

In other words, this computes [self.x == rhs.x, self.y == rhs.y, ..] for all elements.

Source

pub fn cmpne(self, rhs: UVec2) -> BVec2

Returns a vector mask containing the result of a != comparison for each element of self and rhs.

In other words this computes [self.x != rhs.x, self.y != rhs.y, ..] for all elements.

Source

pub fn cmpge(self, rhs: UVec2) -> BVec2

Returns a vector mask containing the result of a >= comparison for each element of self and rhs.

In other words this computes [self.x >= rhs.x, self.y >= rhs.y, ..] for all elements.

Source

pub fn cmpgt(self, rhs: UVec2) -> BVec2

Returns a vector mask containing the result of a > comparison for each element of self and rhs.

In other words this computes [self.x > rhs.x, self.y > rhs.y, ..] for all elements.

Source

pub fn cmple(self, rhs: UVec2) -> BVec2

Returns a vector mask containing the result of a <= comparison for each element of self and rhs.

In other words this computes [self.x <= rhs.x, self.y <= rhs.y, ..] for all elements.

Source

pub fn cmplt(self, rhs: UVec2) -> BVec2

Returns a vector mask containing the result of a < comparison for each element of self and rhs.

In other words this computes [self.x < rhs.x, self.y < rhs.y, ..] for all elements.

Source

pub fn length_squared(self) -> u32

Computes the squared length of self.

Source

pub fn manhattan_distance(self, rhs: UVec2) -> u32

Computes the manhattan distance between two points.

§Overflow

This method may overflow if the result is greater than u32::MAX.

See also checked_manhattan_distance.

Source

pub fn checked_manhattan_distance(self, rhs: UVec2) -> Option<u32>

Computes the manhattan distance between two points.

This will returns None if the result is greater than u32::MAX.

Source

pub fn chebyshev_distance(self, rhs: UVec2) -> u32

Computes the chebyshev distance between two points.

Source

pub fn as_vec2(self) -> Vec2

Casts all elements of self to f32.

Examples found in repository?
examples/shader/compute_shader_game_of_life.rs (line 65)
54fn setup(mut commands: Commands, mut images: ResMut<Assets<Image>>) {
55    let mut image = Image::new_target_texture(SIZE.x, SIZE.y, TextureFormat::Rgba32Float, None);
56    image.asset_usage = RenderAssetUsages::RENDER_WORLD;
57    image.texture_descriptor.usage =
58        TextureUsages::COPY_DST | TextureUsages::STORAGE_BINDING | TextureUsages::TEXTURE_BINDING;
59    let image0 = images.add(image.clone());
60    let image1 = images.add(image);
61
62    commands.spawn((
63        Sprite {
64            image: image0.clone(),
65            custom_size: Some(SIZE.as_vec2()),
66            ..default()
67        },
68        Transform::from_scale(Vec3::splat(DISPLAY_FACTOR as f32)),
69    ));
70    commands.spawn(Camera2d);
71
72    commands.insert_resource(GameOfLifeImages {
73        texture_a: image0,
74        texture_b: image1,
75    });
76
77    commands.insert_resource(GameOfLifeUniforms {
78        alive_color: LinearRgba::RED,
79    });
80}
More examples
Hide additional examples
examples/2d/dynamic_mip_generation.rs (line 649)
629fn spawn_mip_level_views(
630    commands: &mut Commands,
631    app_status: &AppStatus,
632    app_assets: &AppAssets,
633    windows_query: &Query<&Window, With<PrimaryWindow>>,
634    single_mip_level_materials: &mut Assets<SingleMipLevelMaterial>,
635    image_handle: &Handle<Image>,
636) {
637    let window_size = windows_query.iter().next().unwrap().size();
638
639    // Calculate the placement of the column of mipmap levels.
640    let max_slice_size = app_status.max_mip_slice_size(window_size);
641    let y_origin = app_status.vertical_mip_slice_origin(window_size);
642    let y_spacing = app_status.vertical_mip_slice_spacing(window_size);
643    let x_origin = app_status.horizontal_mip_slice_origin(window_size);
644
645    for (mip_level, mip_size) in MipmapSizeIterator::new(app_status).enumerate() {
646        let y_center = y_origin - y_spacing * mip_level as f32;
647
648        // Size each image to fit its container, preserving aspect ratio.
649        let mut slice_size = mip_size.as_vec2();
650        let ratios = max_slice_size / slice_size;
651        let slice_scale = ratios.x.min(ratios.y).min(1.0);
652        slice_size *= slice_scale;
653
654        // Spawn the image. Use the `SingleMipLevelMaterial` with its custom
655        // shader so that only the mip level in question is displayed.
656        commands.spawn((
657            Mesh2d(app_assets.rectangle.clone()),
658            MeshMaterial2d(single_mip_level_materials.add(SingleMipLevelMaterial {
659                mip_level: mip_level as u32,
660                texture: image_handle.clone(),
661            })),
662            Transform::from_xyz(x_origin, y_center, 0.0).with_scale(slice_size.extend(1.0)),
663            ImageView,
664        ));
665
666        // Display a label to the side.
667        commands.spawn((
668            Text2d::new(format!(
669                "Level {}\n{}×{}",
670                mip_level, mip_size.x, mip_size.y
671            )),
672            app_assets.text_font.clone(),
673            TextLayout::justify(Justify::Center),
674            Text2dShadow::default(),
675            Transform::from_xyz(x_origin - max_slice_size.x * 0.5 - 64.0, y_center, 0.0),
676            ImageView,
677        ));
678    }
679}
examples/ui/render_ui_to_texture.rs (line 195)
173fn drive_diegetic_pointer(
174    mut cursor_last: Local<Vec2>,
175    mut raycast: MeshRayCast,
176    rays: Res<RayMap>,
177    cubes: Query<&Mesh3d, With<Cube>>,
178    ui_camera: Query<&RenderTarget, With<Camera2d>>,
179    primary_window: Query<Entity, With<PrimaryWindow>>,
180    windows: Query<(Entity, &Window)>,
181    images: Res<Assets<Image>>,
182    manual_texture_views: Res<ManualTextureViews>,
183    mut window_events: MessageReader<WindowEvent>,
184    mut pointer_inputs: MessageWriter<PointerInput>,
185) -> Result {
186    // Get the size of the texture, so we can convert from dimensionless UV coordinates that span
187    // from 0 to 1, to pixel coordinates.
188    let target = ui_camera
189        .single()?
190        .normalize(primary_window.single().ok())
191        .unwrap();
192    let target_info = target
193        .get_render_target_info(windows, &images, &manual_texture_views)
194        .unwrap();
195    let size = target_info.physical_size.as_vec2();
196
197    // Find raycast hits and update the virtual pointer.
198    let raycast_settings = MeshRayCastSettings {
199        visibility: RayCastVisibility::VisibleInView,
200        filter: &|entity| cubes.contains(entity),
201        early_exit_test: &|_| false,
202    };
203    for (_id, ray) in rays.iter() {
204        for (_cube, hit) in raycast.cast_ray(*ray, &raycast_settings) {
205            let position = size * hit.uv.unwrap();
206            if position != *cursor_last {
207                pointer_inputs.write(PointerInput::new(
208                    CUBE_POINTER_ID,
209                    Location {
210                        target: target.clone(),
211                        position,
212                    },
213                    PointerAction::Move {
214                        delta: position - *cursor_last,
215                    },
216                ));
217                *cursor_last = position;
218            }
219        }
220    }
221
222    // Pipe pointer button presses to the virtual pointer on the UI texture.
223    for window_event in window_events.read() {
224        if let WindowEvent::MouseButtonInput(input) = window_event {
225            let button = match input.button {
226                MouseButton::Left => PointerButton::Primary,
227                MouseButton::Right => PointerButton::Secondary,
228                MouseButton::Middle => PointerButton::Middle,
229                _ => continue,
230            };
231            let action = match input.state {
232                ButtonState::Pressed => PointerAction::Press(button),
233                ButtonState::Released => PointerAction::Release(button),
234            };
235            pointer_inputs.write(PointerInput::new(
236                CUBE_POINTER_ID,
237                Location {
238                    target: target.clone(),
239                    position: *cursor_last,
240                },
241                action,
242            ));
243        }
244    }
245
246    Ok(())
247}
examples/2d/2d_viewport_to_world.rs (line 82)
42fn controls(
43    camera_query: Single<(&mut Camera, &mut Transform, &mut Projection)>,
44    window: Single<&Window>,
45    input: Res<ButtonInput<KeyCode>>,
46    time: Res<Time<Fixed>>,
47) {
48    let (mut camera, mut transform, mut projection) = camera_query.into_inner();
49
50    let fspeed = 600.0 * time.delta_secs();
51    let uspeed = fspeed as u32;
52    let window_size = window.resolution.physical_size();
53
54    // Camera movement controls
55    if input.pressed(KeyCode::ArrowUp) {
56        transform.translation.y += fspeed;
57    }
58    if input.pressed(KeyCode::ArrowDown) {
59        transform.translation.y -= fspeed;
60    }
61    if input.pressed(KeyCode::ArrowLeft) {
62        transform.translation.x -= fspeed;
63    }
64    if input.pressed(KeyCode::ArrowRight) {
65        transform.translation.x += fspeed;
66    }
67
68    // Camera zoom controls
69    if let Projection::Orthographic(projection2d) = &mut *projection {
70        if input.pressed(KeyCode::Comma) {
71            projection2d.scale *= powf(4.0f32, time.delta_secs());
72        }
73
74        if input.pressed(KeyCode::Period) {
75            projection2d.scale *= powf(0.25f32, time.delta_secs());
76        }
77    }
78
79    if let Some(viewport) = camera.viewport.as_mut() {
80        // Reset viewport size on window resize
81        if viewport.physical_size.x > window_size.x || viewport.physical_size.y > window_size.y {
82            viewport.physical_size = (window_size.as_vec2() * 0.75).as_uvec2();
83        }
84
85        // Viewport movement controls
86        if input.pressed(KeyCode::KeyW) {
87            viewport.physical_position.y = viewport.physical_position.y.saturating_sub(uspeed);
88        }
89        if input.pressed(KeyCode::KeyS) {
90            viewport.physical_position.y += uspeed;
91        }
92        if input.pressed(KeyCode::KeyA) {
93            viewport.physical_position.x = viewport.physical_position.x.saturating_sub(uspeed);
94        }
95        if input.pressed(KeyCode::KeyD) {
96            viewport.physical_position.x += uspeed;
97        }
98
99        // Bound viewport position so it doesn't go off-screen
100        viewport.physical_position = viewport
101            .physical_position
102            .min(window_size - viewport.physical_size);
103
104        // Viewport size controls
105        if input.pressed(KeyCode::KeyI) {
106            viewport.physical_size.y = viewport.physical_size.y.saturating_sub(uspeed);
107        }
108        if input.pressed(KeyCode::KeyK) {
109            viewport.physical_size.y += uspeed;
110        }
111        if input.pressed(KeyCode::KeyJ) {
112            viewport.physical_size.x = viewport.physical_size.x.saturating_sub(uspeed);
113        }
114        if input.pressed(KeyCode::KeyL) {
115            viewport.physical_size.x += uspeed;
116        }
117
118        // Bound viewport size so it doesn't go off-screen
119        viewport.physical_size = viewport
120            .physical_size
121            .min(window_size - viewport.physical_position)
122            .max(UVec2::new(20, 20));
123    }
124}
125
126fn setup(
127    mut commands: Commands,
128    mut meshes: ResMut<Assets<Mesh>>,
129    mut materials: ResMut<Assets<ColorMaterial>>,
130    window: Single<&Window>,
131) {
132    let window_size = window.resolution.physical_size().as_vec2();
133
134    // Initialize centered, non-window-filling viewport
135    commands.spawn((
136        Camera2d,
137        Camera {
138            viewport: Some(Viewport {
139                physical_position: (window_size * 0.125).as_uvec2(),
140                physical_size: (window_size * 0.75).as_uvec2(),
141                ..default()
142            }),
143            ..default()
144        },
145    ));
146
147    // Create a minimal UI explaining how to interact with the example
148    commands.spawn((
149        Text::new(
150            "Move the mouse to see the circle follow your cursor.\n\
151                    Use the arrow keys to move the camera.\n\
152                    Use the comma and period keys to zoom in and out.\n\
153                    Use the WASD keys to move the viewport.\n\
154                    Use the IJKL keys to resize the viewport.",
155        ),
156        Node {
157            position_type: PositionType::Absolute,
158            top: px(12),
159            left: px(12),
160            ..default()
161        },
162    ));
163
164    // Add mesh to make camera movement visible
165    commands.spawn((
166        Mesh2d(meshes.add(Rectangle::new(40.0, 20.0))),
167        MeshMaterial2d(materials.add(Color::from(GREEN))),
168    ));
169
170    // Add background to visualize viewport bounds
171    commands.spawn((
172        Mesh2d(meshes.add(Rectangle::new(50000.0, 50000.0))),
173        MeshMaterial2d(materials.add(Color::linear_rgb(0.01, 0.01, 0.01))),
174        Transform::from_translation(Vec3::new(0.0, 0.0, -200.0)),
175    ));
176}
examples/testbed/2d.rs (line 507)
451    pub fn setup(
452        mut commands: Commands,
453        mut textures: ResMut<Assets<Image>>,
454        mut texture_atlases: ResMut<Assets<TextureAtlasLayout>>,
455    ) {
456        commands.spawn((Camera2d, DespawnOnExit(super::Scene::TextureAtlasBuilder)));
457
458        for (i, padding) in [UVec2::ZERO, PADDING_SIZE].into_iter().enumerate() {
459            // generate solid red green and blue and yellow images
460            let images = [
461                [255, 0, 0, 255],
462                [0, 255, 0, 255],
463                [0, 0, 255, 255],
464                [255, 255, 0, 255],
465            ]
466            .map(|pixel| {
467                Image::new_fill(
468                    Extent3d {
469                        width: 28,
470                        height: 28,
471                        depth_or_array_layers: 1,
472                    },
473                    TextureDimension::D2,
474                    &pixel,
475                    TextureFormat::Rgba8UnormSrgb,
476                    RenderAssetUsages::MAIN_WORLD | RenderAssetUsages::RENDER_WORLD,
477                )
478            });
479
480            let mut texture_atlas_builder = TextureAtlasBuilder::default();
481            texture_atlas_builder
482                .initial_size(ATLAS_SIZE)
483                .max_size(ATLAS_SIZE)
484                .padding(padding);
485            for image in &images {
486                texture_atlas_builder.add_texture(None, image);
487            }
488
489            let (atlas_layout, _, atlas_texture) = texture_atlas_builder.build().expect(
490                "The images are 28 pixels square, so they should fit with 4 pixels left over",
491            );
492            let atlas_layout = texture_atlases.add(atlas_layout);
493
494            let mut nearest_atlas_image = atlas_texture.clone();
495            nearest_atlas_image.sampler = ImageSampler::nearest();
496
497            let atlas_handle = textures.add(atlas_texture);
498            let nearest_atlas_handle = textures.add(nearest_atlas_image);
499
500            let position = ((2. * i as f32 - 1.) * (0.625 * ATLAS_SIZE.x as f32 * ATLAS_SCALE))
501                .round()
502                * Vec3::X;
503
504            commands.spawn((
505                Sprite {
506                    image: nearest_atlas_handle,
507                    custom_size: Some(ATLAS_SIZE.as_vec2() * ATLAS_SCALE),
508                    ..default()
509                },
510                Anchor::BOTTOM_CENTER,
511                ShowAabbGizmo {
512                    color: Some(Color::WHITE),
513                },
514                DespawnOnExit(super::Scene::TextureAtlasBuilder),
515                Transform::from_translation(position),
516            ));
517
518            for (index, anchor) in [
519                Anchor::BOTTOM_RIGHT,
520                Anchor::BOTTOM_LEFT,
521                Anchor::TOP_LEFT,
522                Anchor::TOP_RIGHT,
523            ]
524            .into_iter()
525            .enumerate()
526            {
527                commands.spawn((
528                    Sprite {
529                        image: atlas_handle.clone(),
530                        texture_atlas: Some(TextureAtlas {
531                            layout: atlas_layout.clone(),
532                            index,
533                        }),
534                        custom_size: Some(IMAGE_SIZE.as_vec2() * IMAGE_SCALE),
535                        ..default()
536                    },
537                    Transform::from_translation(
538                        position
539                            + -2.
540                                * IMAGE_SCALE
541                                * (Vec3::Y * IMAGE_SIZE.y as f32 + anchor.as_vec().extend(0.)),
542                    ),
543                    anchor,
544                    DespawnOnExit(super::Scene::TextureAtlasBuilder),
545                ));
546            }
547        }
548    }
Source

pub fn as_dvec2(self) -> DVec2

Casts all elements of self to f64.

Source

pub fn as_i8vec2(self) -> I8Vec2

Casts all elements of self to i8.

Source

pub fn as_u8vec2(self) -> U8Vec2

Casts all elements of self to u8.

Source

pub fn as_i16vec2(self) -> I16Vec2

Casts all elements of self to i16.

Source

pub fn as_u16vec2(self) -> U16Vec2

Casts all elements of self to u16.

Source

pub fn as_ivec2(self) -> IVec2

Casts all elements of self to i32.

Source

pub fn as_i64vec2(self) -> I64Vec2

Casts all elements of self to i64.

Source

pub fn as_u64vec2(self) -> U64Vec2

Casts all elements of self to u64.

Source

pub fn as_isizevec2(self) -> ISizeVec2

Casts all elements of self to isize.

Source

pub fn as_usizevec2(self) -> USizeVec2

Casts all elements of self to usize.

Source

pub const fn checked_add(self, rhs: UVec2) -> Option<UVec2>

Returns a vector containing the wrapping addition of self and rhs.

In other words this computes Some([self.x + rhs.x, self.y + rhs.y, ..]) but returns None on any overflow.

Source

pub const fn checked_sub(self, rhs: UVec2) -> Option<UVec2>

Returns a vector containing the wrapping subtraction of self and rhs.

In other words this computes Some([self.x - rhs.x, self.y - rhs.y, ..]) but returns None on any overflow.

Source

pub const fn checked_mul(self, rhs: UVec2) -> Option<UVec2>

Returns a vector containing the wrapping multiplication of self and rhs.

In other words this computes Some([self.x * rhs.x, self.y * rhs.y, ..]) but returns None on any overflow.

Source

pub const fn checked_div(self, rhs: UVec2) -> Option<UVec2>

Returns a vector containing the wrapping division of self and rhs.

In other words this computes Some([self.x / rhs.x, self.y / rhs.y, ..]) but returns None on any division by zero.

Source

pub const fn wrapping_add(self, rhs: UVec2) -> UVec2

Returns a vector containing the wrapping addition of self and rhs.

In other words this computes [self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..].

Source

pub const fn wrapping_sub(self, rhs: UVec2) -> UVec2

Returns a vector containing the wrapping subtraction of self and rhs.

In other words this computes [self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..].

Source

pub const fn wrapping_mul(self, rhs: UVec2) -> UVec2

Returns a vector containing the wrapping multiplication of self and rhs.

In other words this computes [self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..].

Source

pub const fn wrapping_div(self, rhs: UVec2) -> UVec2

Returns a vector containing the wrapping division of self and rhs.

In other words this computes [self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..].

Source

pub const fn saturating_add(self, rhs: UVec2) -> UVec2

Returns a vector containing the saturating addition of self and rhs.

In other words this computes [self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..].

Source

pub const fn saturating_sub(self, rhs: UVec2) -> UVec2

Returns a vector containing the saturating subtraction of self and rhs.

In other words this computes [self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..].

Source

pub const fn saturating_mul(self, rhs: UVec2) -> UVec2

Returns a vector containing the saturating multiplication of self and rhs.

In other words this computes [self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..].

Source

pub const fn saturating_div(self, rhs: UVec2) -> UVec2

Returns a vector containing the saturating division of self and rhs.

In other words this computes [self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..].

Source

pub const fn checked_add_signed(self, rhs: IVec2) -> Option<UVec2>

Returns a vector containing the wrapping addition of self and signed vector rhs.

In other words this computes Some([self.x + rhs.x, self.y + rhs.y, ..]) but returns None on any overflow.

Source

pub const fn wrapping_add_signed(self, rhs: IVec2) -> UVec2

Returns a vector containing the wrapping addition of self and signed vector rhs.

In other words this computes [self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..].

Source

pub const fn saturating_add_signed(self, rhs: IVec2) -> UVec2

Returns a vector containing the saturating addition of self and signed vector rhs.

In other words this computes [self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..].

Trait Implementations§

Source§

impl Add for UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UVec2) -> UVec2

Performs the + operation. Read more
Source§

impl Add<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &UVec2) -> UVec2

Performs the + operation. Read more
Source§

impl Add<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &UVec2) -> UVec2

Performs the + operation. Read more
Source§

impl Add<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &u32) -> UVec2

Performs the + operation. Read more
Source§

impl Add<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &u32) -> UVec2

Performs the + operation. Read more
Source§

impl Add<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UVec2) -> UVec2

Performs the + operation. Read more
Source§

impl Add<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> UVec2

Performs the + operation. Read more
Source§

impl Add<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> UVec2

Performs the + operation. Read more
Source§

impl AddAssign for UVec2

Source§

fn add_assign(&mut self, rhs: UVec2)

Performs the += operation. Read more
Source§

impl AddAssign<&UVec2> for UVec2

Source§

fn add_assign(&mut self, rhs: &UVec2)

Performs the += operation. Read more
Source§

impl AddAssign<&u32> for UVec2

Source§

fn add_assign(&mut self, rhs: &u32)

Performs the += operation. Read more
Source§

impl AddAssign<u32> for UVec2

Source§

fn add_assign(&mut self, rhs: u32)

Performs the += operation. Read more
Source§

impl AsMut<[u32; 2]> for UVec2

Source§

fn as_mut(&mut self) -> &mut [u32; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMutVectorParts<u32, 2> for UVec2

Source§

fn as_mut_parts(&mut self) -> &mut [u32; 2]

Source§

impl AsRef<[u32; 2]> for UVec2

Source§

fn as_ref(&self) -> &[u32; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRefVectorParts<u32, 2> for UVec2

Source§

fn as_ref_parts(&self) -> &[u32; 2]

Source§

impl BitAnd for UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: UVec2) -> <UVec2 as BitAnd>::Output

Performs the & operation. Read more
Source§

impl BitAnd<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &UVec2) -> UVec2

Performs the & operation. Read more
Source§

impl BitAnd<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &UVec2) -> UVec2

Performs the & operation. Read more
Source§

impl BitAnd<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &u32) -> UVec2

Performs the & operation. Read more
Source§

impl BitAnd<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &u32) -> UVec2

Performs the & operation. Read more
Source§

impl BitAnd<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: UVec2) -> UVec2

Performs the & operation. Read more
Source§

impl BitAnd<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: u32) -> <UVec2 as BitAnd<u32>>::Output

Performs the & operation. Read more
Source§

impl BitAnd<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: u32) -> UVec2

Performs the & operation. Read more
Source§

impl BitAndAssign for UVec2

Source§

fn bitand_assign(&mut self, rhs: UVec2)

Performs the &= operation. Read more
Source§

impl BitAndAssign<&UVec2> for UVec2

Source§

fn bitand_assign(&mut self, rhs: &UVec2)

Performs the &= operation. Read more
Source§

impl BitAndAssign<&u32> for UVec2

Source§

fn bitand_assign(&mut self, rhs: &u32)

Performs the &= operation. Read more
Source§

impl BitAndAssign<u32> for UVec2

Source§

fn bitand_assign(&mut self, rhs: u32)

Performs the &= operation. Read more
Source§

impl BitOr for UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: UVec2) -> <UVec2 as BitOr>::Output

Performs the | operation. Read more
Source§

impl BitOr<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &UVec2) -> UVec2

Performs the | operation. Read more
Source§

impl BitOr<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &UVec2) -> UVec2

Performs the | operation. Read more
Source§

impl BitOr<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &u32) -> UVec2

Performs the | operation. Read more
Source§

impl BitOr<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &u32) -> UVec2

Performs the | operation. Read more
Source§

impl BitOr<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: UVec2) -> UVec2

Performs the | operation. Read more
Source§

impl BitOr<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: u32) -> <UVec2 as BitOr<u32>>::Output

Performs the | operation. Read more
Source§

impl BitOr<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: u32) -> UVec2

Performs the | operation. Read more
Source§

impl BitOrAssign for UVec2

Source§

fn bitor_assign(&mut self, rhs: UVec2)

Performs the |= operation. Read more
Source§

impl BitOrAssign<&UVec2> for UVec2

Source§

fn bitor_assign(&mut self, rhs: &UVec2)

Performs the |= operation. Read more
Source§

impl BitOrAssign<&u32> for UVec2

Source§

fn bitor_assign(&mut self, rhs: &u32)

Performs the |= operation. Read more
Source§

impl BitOrAssign<u32> for UVec2

Source§

fn bitor_assign(&mut self, rhs: u32)

Performs the |= operation. Read more
Source§

impl BitXor for UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: UVec2) -> <UVec2 as BitXor>::Output

Performs the ^ operation. Read more
Source§

impl BitXor<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &UVec2) -> UVec2

Performs the ^ operation. Read more
Source§

impl BitXor<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &UVec2) -> UVec2

Performs the ^ operation. Read more
Source§

impl BitXor<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &u32) -> UVec2

Performs the ^ operation. Read more
Source§

impl BitXor<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &u32) -> UVec2

Performs the ^ operation. Read more
Source§

impl BitXor<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: UVec2) -> UVec2

Performs the ^ operation. Read more
Source§

impl BitXor<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: u32) -> <UVec2 as BitXor<u32>>::Output

Performs the ^ operation. Read more
Source§

impl BitXor<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: u32) -> UVec2

Performs the ^ operation. Read more
Source§

impl BitXorAssign for UVec2

Source§

fn bitxor_assign(&mut self, rhs: UVec2)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<&UVec2> for UVec2

Source§

fn bitxor_assign(&mut self, rhs: &UVec2)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<&u32> for UVec2

Source§

fn bitxor_assign(&mut self, rhs: &u32)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<u32> for UVec2

Source§

fn bitxor_assign(&mut self, rhs: u32)

Performs the ^= operation. Read more
Source§

impl Clone for UVec2

Source§

fn clone(&self) -> UVec2

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for UVec2

Source§

impl CreateFrom for UVec2

Source§

fn create_from<B>(reader: &mut Reader<B>) -> UVec2
where B: BufferRef,

Source§

impl Debug for UVec2

Source§

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

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

impl Default for UVec2

Source§

fn default() -> UVec2

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

impl<'de> Deserialize<'de> for UVec2

Deserialize expects a sequence of 2 values.

Source§

fn deserialize<D>( deserializer: D, ) -> Result<UVec2, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl Display for UVec2

Source§

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

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

impl Div for UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UVec2) -> UVec2

Performs the / operation. Read more
Source§

impl Div<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &UVec2) -> UVec2

Performs the / operation. Read more
Source§

impl Div<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &UVec2) -> UVec2

Performs the / operation. Read more
Source§

impl Div<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &u32) -> UVec2

Performs the / operation. Read more
Source§

impl Div<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &u32) -> UVec2

Performs the / operation. Read more
Source§

impl Div<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UVec2) -> UVec2

Performs the / operation. Read more
Source§

impl Div<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u32) -> UVec2

Performs the / operation. Read more
Source§

impl Div<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u32) -> UVec2

Performs the / operation. Read more
Source§

impl DivAssign for UVec2

Source§

fn div_assign(&mut self, rhs: UVec2)

Performs the /= operation. Read more
Source§

impl DivAssign<&UVec2> for UVec2

Source§

fn div_assign(&mut self, rhs: &UVec2)

Performs the /= operation. Read more
Source§

impl DivAssign<&u32> for UVec2

Source§

fn div_assign(&mut self, rhs: &u32)

Performs the /= operation. Read more
Source§

impl DivAssign<u32> for UVec2

Source§

fn div_assign(&mut self, rhs: u32)

Performs the /= operation. Read more
Source§

impl Eq for UVec2

Source§

impl From<(u32, u32)> for UVec2

Source§

fn from(t: (u32, u32)) -> UVec2

Converts to this type from the input type.
Source§

impl From<BVec2> for UVec2

Source§

fn from(v: BVec2) -> UVec2

Converts to this type from the input type.
Source§

impl From<U8Vec2> for UVec2

Source§

fn from(v: U8Vec2) -> UVec2

Converts to this type from the input type.
Source§

impl From<U16Vec2> for UVec2

Source§

fn from(v: U16Vec2) -> UVec2

Converts to this type from the input type.
Source§

impl From<UVec2> for DVec2

Source§

fn from(v: UVec2) -> DVec2

Converts to this type from the input type.
Source§

impl From<UVec2> for I64Vec2

Source§

fn from(v: UVec2) -> I64Vec2

Converts to this type from the input type.
Source§

impl From<UVec2> for U64Vec2

Source§

fn from(v: UVec2) -> U64Vec2

Converts to this type from the input type.
Source§

impl From<UVec2> for RenderTarget

Source§

fn from(value: UVec2) -> RenderTarget

Converts to this type from the input type.
Source§

impl From<UVec2> for WindowResolution

Source§

fn from(res: UVec2) -> WindowResolution

Converts to this type from the input type.
Source§

impl From<[u32; 2]> for UVec2

Source§

fn from(a: [u32; 2]) -> UVec2

Converts to this type from the input type.
Source§

impl FromArg for UVec2

Source§

type This<'from_arg> = UVec2

The type to convert into. Read more
Source§

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

Creates an item from an argument. Read more
Source§

impl FromReflect for UVec2

Source§

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

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 FromVectorParts<u32, 2> for UVec2
where UVec2: From<[u32; 2]>, u32: VectorScalar,

Source§

fn from_parts(parts: [u32; 2]) -> UVec2

Source§

impl GetOwnership for UVec2

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl GetTypeRegistration for UVec2

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 Hash for UVec2

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Index<usize> for UVec2

Source§

type Output = u32

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &<UVec2 as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for UVec2

Source§

fn index_mut(&mut self, index: usize) -> &mut <UVec2 as Index<usize>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IntoReturn for UVec2

Source§

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

Converts Self into a Return value.
Source§

impl Mul for UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UVec2) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &UVec2) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &UVec2) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &u32) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &u32) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UVec2) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u32) -> UVec2

Performs the * operation. Read more
Source§

impl Mul<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u32) -> UVec2

Performs the * operation. Read more
Source§

impl MulAssign for UVec2

Source§

fn mul_assign(&mut self, rhs: UVec2)

Performs the *= operation. Read more
Source§

impl MulAssign<&UVec2> for UVec2

Source§

fn mul_assign(&mut self, rhs: &UVec2)

Performs the *= operation. Read more
Source§

impl MulAssign<&u32> for UVec2

Source§

fn mul_assign(&mut self, rhs: &u32)

Performs the *= operation. Read more
Source§

impl MulAssign<u32> for UVec2

Source§

fn mul_assign(&mut self, rhs: u32)

Performs the *= operation. Read more
Source§

impl Not for UVec2

Source§

type Output = UVec2

The resulting type after applying the ! operator.
Source§

fn not(self) -> UVec2

Performs the unary ! operation. Read more
Source§

impl Not for &UVec2

Source§

type Output = UVec2

The resulting type after applying the ! operator.
Source§

fn not(self) -> UVec2

Performs the unary ! operation. Read more
Source§

impl PartialEq for UVec2

Source§

fn eq(&self, other: &UVec2) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialReflect for UVec2

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

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

fn try_into_reflect( self: Box<UVec2>, ) -> 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<UVec2>) -> 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_hash(&self) -> Option<u64>

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

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

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

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

Returns a “partial 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.
Source§

fn is_dynamic(&self) -> bool

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

impl Pod for UVec2

Source§

impl Product for UVec2

Source§

fn product<I>(iter: I) -> UVec2
where I: Iterator<Item = UVec2>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<'a> Product<&'a UVec2> for UVec2

Source§

fn product<I>(iter: I) -> UVec2
where I: Iterator<Item = &'a UVec2>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl ReadFrom for UVec2

Source§

fn read_from<B>(&mut self, reader: &mut Reader<B>)
where B: BufferRef,

Source§

impl Reflect for UVec2

Source§

fn into_any(self: Box<UVec2>) -> 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<UVec2>) -> 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 Rem for UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UVec2) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &UVec2) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &UVec2) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &u32) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &u32) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UVec2) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u32) -> UVec2

Performs the % operation. Read more
Source§

impl Rem<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u32) -> UVec2

Performs the % operation. Read more
Source§

impl RemAssign for UVec2

Source§

fn rem_assign(&mut self, rhs: UVec2)

Performs the %= operation. Read more
Source§

impl RemAssign<&UVec2> for UVec2

Source§

fn rem_assign(&mut self, rhs: &UVec2)

Performs the %= operation. Read more
Source§

impl RemAssign<&u32> for UVec2

Source§

fn rem_assign(&mut self, rhs: &u32)

Performs the %= operation. Read more
Source§

impl RemAssign<u32> for UVec2

Source§

fn rem_assign(&mut self, rhs: u32)

Performs the %= operation. Read more
Source§

impl SampleUniform for UVec2

Source§

type Sampler = UniformVec2<UniformInt<u32>>

The UniformSampler implementation supporting type X.
Source§

impl Serialize for UVec2

Serialize as a sequence of 2 values.

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ShaderSize for UVec2
where u32: ShaderSize,

Source§

const SHADER_SIZE: NonZero<u64> = _

Represents WGSL Size (equivalent to ShaderType::min_size)
Source§

impl ShaderType for UVec2
where u32: ShaderSize,

Source§

fn min_size() -> NonZero<u64>

Represents the minimum size of Self (equivalent to GPUBufferBindingLayout.minBindingSize) Read more
Source§

fn size(&self) -> NonZero<u64>

Returns the size of Self at runtime Read more
Source§

fn assert_uniform_compat()

Source§

impl Shl for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&IVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &IVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&IVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &IVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> I8Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> I8Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> U8Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> U8Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> I16Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> I16Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> U16Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> U16Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for IVec2

Source§

type Output = IVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> IVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &IVec2

Source§

type Output = IVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> IVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> I64Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> I64Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> U64Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> U64Vec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> USizeVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> USizeVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> ISizeVec2

Performs the << operation. Read more
Source§

impl Shl<&UVec2> for &ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &UVec2) -> ISizeVec2

Performs the << operation. Read more
Source§

impl Shl<&i8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&i64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<&u64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<IVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: IVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<IVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: IVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> I8Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> I8Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> U8Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> U8Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> I16Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> I16Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> U16Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> U16Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for IVec2

Source§

type Output = IVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> IVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &IVec2

Source§

type Output = IVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> IVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> I64Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> I64Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> U64Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> U64Vec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> USizeVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> USizeVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> ISizeVec2

Performs the << operation. Read more
Source§

impl Shl<UVec2> for &ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: UVec2) -> ISizeVec2

Performs the << operation. Read more
Source§

impl Shl<i8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> <UVec2 as Shl<i8>>::Output

Performs the << operation. Read more
Source§

impl Shl<i8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<i16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> <UVec2 as Shl<i16>>::Output

Performs the << operation. Read more
Source§

impl Shl<i16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<i32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> <UVec2 as Shl<i32>>::Output

Performs the << operation. Read more
Source§

impl Shl<i32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<i64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> <UVec2 as Shl<i64>>::Output

Performs the << operation. Read more
Source§

impl Shl<i64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<u8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> <UVec2 as Shl<u8>>::Output

Performs the << operation. Read more
Source§

impl Shl<u8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<u16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> <UVec2 as Shl<u16>>::Output

Performs the << operation. Read more
Source§

impl Shl<u16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> <UVec2 as Shl<u32>>::Output

Performs the << operation. Read more
Source§

impl Shl<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> UVec2

Performs the << operation. Read more
Source§

impl Shl<u64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> <UVec2 as Shl<u64>>::Output

Performs the << operation. Read more
Source§

impl Shl<u64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> UVec2

Performs the << operation. Read more
Source§

impl ShlAssign<&i8> for UVec2

Source§

fn shl_assign(&mut self, rhs: &i8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i16> for UVec2

Source§

fn shl_assign(&mut self, rhs: &i16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i32> for UVec2

Source§

fn shl_assign(&mut self, rhs: &i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i64> for UVec2

Source§

fn shl_assign(&mut self, rhs: &i64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u8> for UVec2

Source§

fn shl_assign(&mut self, rhs: &u8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u16> for UVec2

Source§

fn shl_assign(&mut self, rhs: &u16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u32> for UVec2

Source§

fn shl_assign(&mut self, rhs: &u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u64> for UVec2

Source§

fn shl_assign(&mut self, rhs: &u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i8> for UVec2

Source§

fn shl_assign(&mut self, rhs: i8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i16> for UVec2

Source§

fn shl_assign(&mut self, rhs: i16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i32> for UVec2

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i64> for UVec2

Source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u8> for UVec2

Source§

fn shl_assign(&mut self, rhs: u8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u16> for UVec2

Source§

fn shl_assign(&mut self, rhs: u16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u32> for UVec2

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u64> for UVec2

Source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
Source§

impl Shr for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&IVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &IVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&IVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &IVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> I8Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> I8Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> U8Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> U8Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> I16Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> I16Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> U16Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> U16Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for IVec2

Source§

type Output = IVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> IVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &IVec2

Source§

type Output = IVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> IVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> I64Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> I64Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> U64Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> U64Vec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> USizeVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> USizeVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> ISizeVec2

Performs the >> operation. Read more
Source§

impl Shr<&UVec2> for &ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &UVec2) -> ISizeVec2

Performs the >> operation. Read more
Source§

impl Shr<&i8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&i64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<&u64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<IVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: IVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<IVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: IVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> I8Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &I8Vec2

Source§

type Output = I8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> I8Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> U8Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &U8Vec2

Source§

type Output = U8Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> U8Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> I16Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &I16Vec2

Source§

type Output = I16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> I16Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> U16Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &U16Vec2

Source§

type Output = U16Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> U16Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for IVec2

Source§

type Output = IVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> IVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &IVec2

Source§

type Output = IVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> IVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> I64Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &I64Vec2

Source§

type Output = I64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> I64Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> U64Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &U64Vec2

Source§

type Output = U64Vec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> U64Vec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> USizeVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &USizeVec2

Source§

type Output = USizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> USizeVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> ISizeVec2

Performs the >> operation. Read more
Source§

impl Shr<UVec2> for &ISizeVec2

Source§

type Output = ISizeVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: UVec2) -> ISizeVec2

Performs the >> operation. Read more
Source§

impl Shr<i8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> <UVec2 as Shr<i8>>::Output

Performs the >> operation. Read more
Source§

impl Shr<i8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<i16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> <UVec2 as Shr<i16>>::Output

Performs the >> operation. Read more
Source§

impl Shr<i16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<i32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> <UVec2 as Shr<i32>>::Output

Performs the >> operation. Read more
Source§

impl Shr<i32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<i64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> <UVec2 as Shr<i64>>::Output

Performs the >> operation. Read more
Source§

impl Shr<i64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<u8> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> <UVec2 as Shr<u8>>::Output

Performs the >> operation. Read more
Source§

impl Shr<u8> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<u16> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> <UVec2 as Shr<u16>>::Output

Performs the >> operation. Read more
Source§

impl Shr<u16> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> <UVec2 as Shr<u32>>::Output

Performs the >> operation. Read more
Source§

impl Shr<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> UVec2

Performs the >> operation. Read more
Source§

impl Shr<u64> for UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> <UVec2 as Shr<u64>>::Output

Performs the >> operation. Read more
Source§

impl Shr<u64> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> UVec2

Performs the >> operation. Read more
Source§

impl ShrAssign<&i8> for UVec2

Source§

fn shr_assign(&mut self, rhs: &i8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i16> for UVec2

Source§

fn shr_assign(&mut self, rhs: &i16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i32> for UVec2

Source§

fn shr_assign(&mut self, rhs: &i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i64> for UVec2

Source§

fn shr_assign(&mut self, rhs: &i64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u8> for UVec2

Source§

fn shr_assign(&mut self, rhs: &u8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u16> for UVec2

Source§

fn shr_assign(&mut self, rhs: &u16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u32> for UVec2

Source§

fn shr_assign(&mut self, rhs: &u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u64> for UVec2

Source§

fn shr_assign(&mut self, rhs: &u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i8> for UVec2

Source§

fn shr_assign(&mut self, rhs: i8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i16> for UVec2

Source§

fn shr_assign(&mut self, rhs: i16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i32> for UVec2

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i64> for UVec2

Source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u8> for UVec2

Source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u16> for UVec2

Source§

fn shr_assign(&mut self, rhs: u16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u32> for UVec2

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u64> for UVec2

Source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
Source§

impl Struct for UVec2

Source§

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

Gets 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)>

Gets 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)>

Gets 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)>

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

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

fn index_of_name(&self, name: &str) -> Option<usize>

Gets the index of the field with the given name.
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 StructuralPartialEq for UVec2

Source§

impl Sub for UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UVec2) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<&UVec2> for UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &UVec2) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<&UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &UVec2) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<&u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &u32) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<&u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &u32) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<UVec2> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UVec2) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<u32> for UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> UVec2

Performs the - operation. Read more
Source§

impl Sub<u32> for &UVec2

Source§

type Output = UVec2

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> UVec2

Performs the - operation. Read more
Source§

impl SubAssign for UVec2

Source§

fn sub_assign(&mut self, rhs: UVec2)

Performs the -= operation. Read more
Source§

impl SubAssign<&UVec2> for UVec2

Source§

fn sub_assign(&mut self, rhs: &UVec2)

Performs the -= operation. Read more
Source§

impl SubAssign<&u32> for UVec2

Source§

fn sub_assign(&mut self, rhs: &u32)

Performs the -= operation. Read more
Source§

impl SubAssign<u32> for UVec2

Source§

fn sub_assign(&mut self, rhs: u32)

Performs the -= operation. Read more
Source§

impl Sum for UVec2

Source§

fn sum<I>(iter: I) -> UVec2
where I: Iterator<Item = UVec2>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<'a> Sum<&'a UVec2> for UVec2

Source§

fn sum<I>(iter: I) -> UVec2
where I: Iterator<Item = &'a UVec2>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl ToExtents for UVec2

Source§

fn to_extents(self) -> Extent3d

Converts this type to an Extent3d.
Source§

impl TryFrom<I8Vec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: I8Vec2) -> Result<UVec2, <UVec2 as TryFrom<I8Vec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<I16Vec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: I16Vec2) -> Result<UVec2, <UVec2 as TryFrom<I16Vec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<I64Vec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: I64Vec2) -> Result<UVec2, <UVec2 as TryFrom<I64Vec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<ISizeVec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: ISizeVec2) -> Result<UVec2, <UVec2 as TryFrom<ISizeVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<IVec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: IVec2) -> Result<UVec2, <UVec2 as TryFrom<IVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<U64Vec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: U64Vec2) -> Result<UVec2, <UVec2 as TryFrom<U64Vec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<USizeVec2> for UVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: USizeVec2) -> Result<UVec2, <UVec2 as TryFrom<USizeVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for I8Vec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<I8Vec2, <I8Vec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for U8Vec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<U8Vec2, <U8Vec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for I16Vec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<I16Vec2, <I16Vec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for U16Vec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<U16Vec2, <U16Vec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for IVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<IVec2, <IVec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for USizeVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<USizeVec2, <USizeVec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TryFrom<UVec2> for ISizeVec2

Source§

type Error = TryFromIntError

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

fn try_from(v: UVec2) -> Result<ISizeVec2, <ISizeVec2 as TryFrom<UVec2>>::Error>

Performs the conversion.
Source§

impl TypePath for UVec2

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 UVec2

Source§

fn type_info() -> &'static TypeInfo

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

impl Vec2Swizzles for UVec2

Source§

type Vec3 = UVec3

Source§

type Vec4 = UVec4

Source§

fn xx(self) -> UVec2

Source§

fn yx(self) -> UVec2

Source§

fn yy(self) -> UVec2

Source§

fn xxx(self) -> UVec3

Source§

fn xxy(self) -> UVec3

Source§

fn xyx(self) -> UVec3

Source§

fn xyy(self) -> UVec3

Source§

fn yxx(self) -> UVec3

Source§

fn yxy(self) -> UVec3

Source§

fn yyx(self) -> UVec3

Source§

fn yyy(self) -> UVec3

Source§

fn xxxx(self) -> UVec4

Source§

fn xxxy(self) -> UVec4

Source§

fn xxyx(self) -> UVec4

Source§

fn xxyy(self) -> UVec4

Source§

fn xyxx(self) -> UVec4

Source§

fn xyxy(self) -> UVec4

Source§

fn xyyx(self) -> UVec4

Source§

fn xyyy(self) -> UVec4

Source§

fn yxxx(self) -> UVec4

Source§

fn yxxy(self) -> UVec4

Source§

fn yxyx(self) -> UVec4

Source§

fn yxyy(self) -> UVec4

Source§

fn yyxx(self) -> UVec4

Source§

fn yyxy(self) -> UVec4

Source§

fn yyyx(self) -> UVec4

Source§

fn yyyy(self) -> UVec4

Source§

fn xy(self) -> Self

Source§

impl WriteInto for UVec2

Source§

fn write_into<B>(&self, writer: &mut Writer<B>)
where B: BufferMut,

Source§

impl Zeroable for UVec2

Source§

fn zeroed() -> Self

Auto Trait Implementations§

§

impl Freeze for UVec2

§

impl RefUnwindSafe for UVec2

§

impl Send for UVec2

§

impl Sync for UVec2

§

impl Unpin for UVec2

§

impl UnsafeUnpin for UVec2

§

impl UnwindSafe for UVec2

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> AnyBitPattern for T
where T: Pod,

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> Brush for T
where T: Clone + PartialEq + Default + Debug,

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
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> ConditionalSend for T
where T: Send,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynEq for T
where T: Any + Eq,

Source§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
Source§

impl<T> DynHash for T
where T: DynEq + Hash,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feeds this value into the given Hasher.
Source§

impl<T> DynamicTypePath for T
where T: TypePath,

Source§

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

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> FromTemplate for T
where T: Clone + Default + Unpin,

Source§

type Template = T

The Template for this type.
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,

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

Gets 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> GpuArrayBufferable for T

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> HitDataExtra for T
where T: Send + Sync + Debug + Any + 'static,

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> Interleave for T
where T: Pod,

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> NoUninit for T
where T: Pod,

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, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<G> PatchFromTemplate for G
where G: FromTemplate,

Source§

type Template = <G as FromTemplate>::Template

The Template that will be patched.
Source§

fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
where F: FnOnce(&mut <G as PatchFromTemplate>::Template, &mut ResolveContext<'_>),

Takes a “patch function” func, and turns it into a TemplatePatch.
Source§

impl<T> PatchTemplate for T
where T: Template,

Source§

fn patch_template<F>(func: F) -> TemplatePatch<F, T>
where F: FnOnce(&mut T, &mut ResolveContext<'_>),

Takes a “patch function” func that patches this Template, and turns it into a TemplatePatch.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,

Source§

impl<T> Reflectable for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Borrowed> SampleBorrow<Borrowed> for Borrowed
where Borrowed: SampleUniform,

Source§

fn borrow(&self) -> &Borrowed

Immutably borrows from an owned value. See Borrow::borrow
Source§

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

Source§

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

Source§

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

Source§

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

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> Template for T
where T: Clone + Default + Unpin,

Source§

type Output = T

The type of value produced by this Template.
Source§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a Template::Output.
Source§

fn clone_template(&self) -> T

Clones this template. See Clone.
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> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

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

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