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/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 71)
65fn spawn_fake_player(
66    mut commands: Commands,
67    mut meshes: ResMut<Assets<Mesh>>,
68    mut materials: ResMut<Assets<ColorMaterial>>,
69    chunk: Single<&TilemapChunk>,
70) {
71    let mut transform = chunk.calculate_tile_transform(UVec2::new(0, 0));
72    transform.translation.z = 1.;
73
74    commands.spawn((
75        Mesh2d(meshes.add(Rectangle::new(8., 8.))),
76        MeshMaterial2d(materials.add(Color::from(RED_400))),
77        transform,
78        MovePlayer,
79    ));
80
81    let mut transform = chunk.calculate_tile_transform(UVec2::new(5, 6));
82    transform.translation.z = 1.;
83
84    // second "player" to visually test a non-zero position
85    commands.spawn((
86        Mesh2d(meshes.add(Rectangle::new(8., 8.))),
87        MeshMaterial2d(materials.add(Color::from(RED_400))),
88        transform,
89    ));
90}
91
92fn move_player(
93    mut player: Single<&mut Transform, With<MovePlayer>>,
94    time: Res<Time>,
95    chunk: Single<&TilemapChunk>,
96) {
97    let t = (ops::sin(time.elapsed_secs()) + 1.) / 2.;
98
99    let origin = chunk
100        .calculate_tile_transform(UVec2::new(0, 0))
101        .translation
102        .x;
103    let destination = chunk
104        .calculate_tile_transform(UVec2::new(63, 0))
105        .translation
106        .x;
107
108    player.translation.x = origin.lerp(destination, t);
109}
110
111fn update_tileset_image(
112    chunk_query: Single<&TilemapChunk>,
113    mut events: MessageReader<AssetEvent<Image>>,
114    mut images: ResMut<Assets<Image>>,
115) {
116    let chunk = *chunk_query;
117    for event in events.read() {
118        if event.is_loaded_with_dependencies(chunk.tileset.id()) {
119            let image = images.get_mut(&chunk.tileset).unwrap();
120            image.reinterpret_stacked_2d_as_array(4);
121        }
122    }
123}
124
125fn update_tilemap(
126    time: Res<Time>,
127    mut query: Query<(&mut TilemapChunkTileData, &mut UpdateTimer)>,
128    mut rng: ResMut<SeededRng>,
129) {
130    for (mut tile_data, mut timer) in query.iter_mut() {
131        timer.tick(time.delta());
132
133        if timer.just_finished() {
134            for _ in 0..50 {
135                let index = rng.random_range(0..tile_data.len());
136                tile_data[index] = Some(TileData::from_tileset_index(rng.random_range(0..5)));
137            }
138        }
139    }
140}
141
142// find the data for an arbitrary tile in the chunk and log its data
143fn log_tile(tilemap: Single<(&TilemapChunk, &TilemapChunkTileData)>, mut local: Local<u16>) {
144    let (chunk, data) = tilemap.into_inner();
145    let Some(tile_data) = data.tile_data_from_tile_pos(chunk.chunk_size, UVec2::new(3, 4)) else {
146        return;
147    };
148    // log when the tile changes
149    if tile_data.tileset_index != *local {
150        info!(?tile_data, "tile_data changed");
151        *local = tile_data.tileset_index;
152    }
153}
examples/testbed/2d.rs (line 310)
290    pub fn draw_gizmos(mut gizmos: Gizmos) {
291        gizmos.rect_2d(
292            Isometry2d::from_translation(Vec2::new(-200.0, 0.0)),
293            Vec2::new(200.0, 200.0),
294            RED,
295        );
296        gizmos
297            .circle_2d(
298                Isometry2d::from_translation(Vec2::new(-200.0, 0.0)),
299                200.0,
300                GREEN,
301            )
302            .resolution(64);
303
304        // 2d grids with all variations of outer edges on or off
305        for i in 0..4 {
306            let x = 200.0 * (1.0 + (i % 2) as f32);
307            let y = 150.0 * (0.5 - (i / 2) as f32);
308            let mut grid = gizmos.grid(
309                Vec3::new(x, y, 0.0),
310                UVec2::new(5, 4),
311                Vec2::splat(30.),
312                Color::WHITE,
313            );
314            if i & 1 > 0 {
315                grid = grid.outer_edges_x();
316            }
317            if i & 2 > 0 {
318                grid.outer_edges_y();
319            }
320        }
321    }
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}
examples/shader/automatic_instancing.rs (line 46)
26fn setup(
27    mut commands: Commands,
28    assets: Res<AssetServer>,
29    mut meshes: ResMut<Assets<Mesh>>,
30    mut materials: ResMut<Assets<CustomMaterial>>,
31) {
32    // We will use this image as our external data for our material to sample from in the vertex shader
33    let image = assets.load("branding/icon.png");
34
35    // Our single mesh handle that will be instanced
36    let mesh_handle = meshes.add(Cuboid::from_size(Vec3::splat(0.01)));
37
38    // Create the custom material with a reference to our texture
39    // Automatic instancing works with any Material, including the `StandardMaterial`.
40    // This custom material is used to demonstrate the optional `MeshTag` feature.
41    let material_handle = materials.add(CustomMaterial {
42        image: image.clone(),
43    });
44
45    // We're hardcoding the image dimensions for simplicity
46    let image_dims = UVec2::new(256, 256);
47    let total_pixels = image_dims.x * image_dims.y;
48
49    for index in 0..total_pixels {
50        // Get x,y from index - x goes left to right, y goes top to bottom
51        let x = index % image_dims.x;
52        let y = index / image_dims.x;
53
54        // Convert to centered world coordinates
55        let world_x = (x as f32 - image_dims.x as f32 / 2.0) / 50.0;
56        let world_y = -((y as f32 - image_dims.y as f32 / 2.0) / 50.0); // Still need negative for world space
57
58        commands.spawn((
59            // For automatic instancing to take effect you need to
60            // use the same mesh handle and material handle for each instance
61            Mesh3d(mesh_handle.clone()),
62            MeshMaterial3d(material_handle.clone()),
63            // This is an optional component that can be used to help tie external data to a mesh instance
64            MeshTag(index),
65            Transform::from_xyz(world_x, world_y, 0.0),
66        ));
67    }
68
69    // Camera
70    commands.spawn((
71        Camera3d::default(),
72        Transform::from_xyz(0.0, 0.0, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
73    ));
74}
Source

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

Creates a vector with all elements set to v.

Examples found in repository?
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}
More examples
Hide additional examples
examples/2d/tilemap_chunk.rs (line 33)
28fn setup(mut commands: Commands, assets: Res<AssetServer>) {
29    // We're seeding the PRNG here to make this example deterministic for testing purposes.
30    // This isn't strictly required in practical use unless you need your app to be deterministic.
31    let mut rng = ChaCha8Rng::seed_from_u64(42);
32
33    let chunk_size = UVec2::splat(64);
34    let tile_display_size = UVec2::splat(8);
35    let tile_data: Vec<Option<TileData>> = (0..chunk_size.element_product())
36        .map(|_| rng.random_range(0..5))
37        .map(|i| {
38            if i == 0 {
39                None
40            } else {
41                Some(TileData::from_tileset_index(i - 1))
42            }
43        })
44        .collect();
45
46    commands.spawn((
47        TilemapChunk {
48            chunk_size,
49            tile_display_size,
50            tileset: assets.load("textures/array_texture.png"),
51            ..default()
52        },
53        TilemapChunkTileData(tile_data),
54        UpdateTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
55    ));
56
57    commands.spawn(Camera2d);
58
59    commands.insert_resource(SeededRng(rng));
60}
examples/shader_advanced/render_depth_to_texture.rs (line 229)
219fn spawn_depth_only_camera(commands: &mut Commands) {
220    commands.spawn((
221        Camera3d::default(),
222        Transform::from_xyz(-4.0, -5.0, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
223        Camera {
224            // We specify no color render target, for maximum efficiency.
225            target: RenderTarget::None {
226                // When specifying no render target, we must manually specify
227                // the viewport size. Otherwise, Bevy won't know how big to make
228                // the depth buffer.
229                size: UVec2::splat(DEPTH_TEXTURE_SIZE),
230            },
231            // Make sure that we render from this depth-only camera *before*
232            // rendering from the main camera.
233            order: -1,
234            ..Camera::default()
235        },
236        // We need to disable multisampling or the depth texture will be
237        // multisampled, which adds complexity we don't care about for this
238        // demo.
239        Msaa::Off,
240        // Cameras with no render target render *nothing* by default. To get
241        // them to render something, we must add a prepass that specifies what
242        // we want to render: in this case, depth.
243        DepthPrepass,
244    ));
245}
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/ui/ui_texture_atlas.rs (line 29)
18fn setup(
19    mut commands: Commands,
20    asset_server: Res<AssetServer>,
21    mut texture_atlases: ResMut<Assets<TextureAtlasLayout>>,
22) {
23    // Camera
24    commands.spawn(Camera2d);
25
26    let text_font = TextFont::default();
27
28    let texture_handle = asset_server.load("textures/rpg/chars/gabe/gabe-idle-run.png");
29    let texture_atlas = TextureAtlasLayout::from_grid(UVec2::splat(24), 7, 1, None, None);
30    let texture_atlas_handle = texture_atlases.add(texture_atlas);
31
32    // root node
33    commands
34        .spawn(Node {
35            width: percent(100),
36            height: percent(100),
37            flex_direction: FlexDirection::Column,
38            justify_content: JustifyContent::Center,
39            align_items: AlignItems::Center,
40            row_gap: px(text_font.font_size * 2.),
41            ..default()
42        })
43        .with_children(|parent| {
44            parent.spawn((
45                ImageNode::from_atlas_image(
46                    texture_handle,
47                    TextureAtlas::from(texture_atlas_handle),
48                ),
49                Node {
50                    width: px(256),
51                    height: px(256),
52                    ..default()
53                },
54                BackgroundColor(ANTIQUE_WHITE.into()),
55                Outline::new(px(8), Val::ZERO, CRIMSON.into()),
56            ));
57            parent
58                .spawn((Text::new("press "), text_font.clone()))
59                .with_child((
60                    TextSpan::new("space"),
61                    TextColor(YELLOW.into()),
62                    text_font.clone(),
63                ))
64                .with_child((TextSpan::new(" to advance frames"), text_font));
65        });
66}
examples/usage/cooldown.rs (line 29)
22fn setup(
23    mut commands: Commands,
24    mut texture_atlas_layouts: ResMut<Assets<TextureAtlasLayout>>,
25    asset_server: Res<AssetServer>,
26) {
27    commands.spawn(Camera2d);
28    let texture = asset_server.load("textures/food_kenney.png");
29    let layout = TextureAtlasLayout::from_grid(UVec2::splat(64), 7, 7, None, None);
30    let texture_atlas_layout = texture_atlas_layouts.add(layout);
31    commands.spawn((
32        Node {
33            width: percent(100),
34            height: percent(100),
35            align_items: AlignItems::Center,
36            justify_content: JustifyContent::Center,
37            column_gap: px(15),
38            ..default()
39        },
40        Children::spawn(SpawnIter(
41            [
42                FoodItem {
43                    name: "an apple",
44                    cooldown: 2.,
45                    index: 2,
46                },
47                FoodItem {
48                    name: "a burger",
49                    cooldown: 1.,
50                    index: 23,
51                },
52                FoodItem {
53                    name: "chocolate",
54                    cooldown: 10.,
55                    index: 32,
56                },
57                FoodItem {
58                    name: "cherries",
59                    cooldown: 4.,
60                    index: 41,
61                },
62            ]
63            .into_iter()
64            .map(move |food| build_ability(food, texture.clone(), texture_atlas_layout.clone())),
65        )),
66    ));
67    commands.spawn((
68        Text::new("*Click some food to eat it*"),
69        Node {
70            position_type: PositionType::Absolute,
71            top: px(12),
72            left: px(12),
73            ..default()
74        },
75    ));
76}
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 97)
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        // Viewport movement controls
81        if input.pressed(KeyCode::KeyW) {
82            viewport.physical_position.y = viewport.physical_position.y.saturating_sub(uspeed);
83        }
84        if input.pressed(KeyCode::KeyS) {
85            viewport.physical_position.y += uspeed;
86        }
87        if input.pressed(KeyCode::KeyA) {
88            viewport.physical_position.x = viewport.physical_position.x.saturating_sub(uspeed);
89        }
90        if input.pressed(KeyCode::KeyD) {
91            viewport.physical_position.x += uspeed;
92        }
93
94        // Bound viewport position so it doesn't go off-screen
95        viewport.physical_position = viewport
96            .physical_position
97            .min(window_size - viewport.physical_size);
98
99        // Viewport size controls
100        if input.pressed(KeyCode::KeyI) {
101            viewport.physical_size.y = viewport.physical_size.y.saturating_sub(uspeed);
102        }
103        if input.pressed(KeyCode::KeyK) {
104            viewport.physical_size.y += uspeed;
105        }
106        if input.pressed(KeyCode::KeyJ) {
107            viewport.physical_size.x = viewport.physical_size.x.saturating_sub(uspeed);
108        }
109        if input.pressed(KeyCode::KeyL) {
110            viewport.physical_size.x += uspeed;
111        }
112
113        // Bound viewport size so it doesn't go off-screen
114        viewport.physical_size = viewport
115            .physical_size
116            .min(window_size - viewport.physical_position)
117            .max(UVec2::new(20, 20));
118    }
119}
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/2d_viewport_to_world.rs (line 117)
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        // Viewport movement controls
81        if input.pressed(KeyCode::KeyW) {
82            viewport.physical_position.y = viewport.physical_position.y.saturating_sub(uspeed);
83        }
84        if input.pressed(KeyCode::KeyS) {
85            viewport.physical_position.y += uspeed;
86        }
87        if input.pressed(KeyCode::KeyA) {
88            viewport.physical_position.x = viewport.physical_position.x.saturating_sub(uspeed);
89        }
90        if input.pressed(KeyCode::KeyD) {
91            viewport.physical_position.x += uspeed;
92        }
93
94        // Bound viewport position so it doesn't go off-screen
95        viewport.physical_position = viewport
96            .physical_position
97            .min(window_size - viewport.physical_size);
98
99        // Viewport size controls
100        if input.pressed(KeyCode::KeyI) {
101            viewport.physical_size.y = viewport.physical_size.y.saturating_sub(uspeed);
102        }
103        if input.pressed(KeyCode::KeyK) {
104            viewport.physical_size.y += uspeed;
105        }
106        if input.pressed(KeyCode::KeyJ) {
107            viewport.physical_size.x = viewport.physical_size.x.saturating_sub(uspeed);
108        }
109        if input.pressed(KeyCode::KeyL) {
110            viewport.physical_size.x += uspeed;
111        }
112
113        // Bound viewport size so it doesn't go off-screen
114        viewport.physical_size = viewport
115            .physical_size
116            .min(window_size - viewport.physical_position)
117            .max(UVec2::new(20, 20));
118    }
119}
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 35)
28fn setup(mut commands: Commands, assets: Res<AssetServer>) {
29    // We're seeding the PRNG here to make this example deterministic for testing purposes.
30    // This isn't strictly required in practical use unless you need your app to be deterministic.
31    let mut rng = ChaCha8Rng::seed_from_u64(42);
32
33    let chunk_size = UVec2::splat(64);
34    let tile_display_size = UVec2::splat(8);
35    let tile_data: Vec<Option<TileData>> = (0..chunk_size.element_product())
36        .map(|_| rng.random_range(0..5))
37        .map(|i| {
38            if i == 0 {
39                None
40            } else {
41                Some(TileData::from_tileset_index(i - 1))
42            }
43        })
44        .collect();
45
46    commands.spawn((
47        TilemapChunk {
48            chunk_size,
49            tile_display_size,
50            tileset: assets.load("textures/array_texture.png"),
51            ..default()
52        },
53        TilemapChunkTileData(tile_data),
54        UpdateTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
55    ));
56
57    commands.spawn(Camera2d);
58
59    commands.insert_resource(SeededRng(rng));
60}
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);
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/2d_viewport_to_world.rs (line 127)
121fn setup(
122    mut commands: Commands,
123    mut meshes: ResMut<Assets<Mesh>>,
124    mut materials: ResMut<Assets<ColorMaterial>>,
125    window: Single<&Window>,
126) {
127    let window_size = window.resolution.physical_size().as_vec2();
128
129    // Initialize centered, non-window-filling viewport
130    commands.spawn((
131        Camera2d,
132        Camera {
133            viewport: Some(Viewport {
134                physical_position: (window_size * 0.125).as_uvec2(),
135                physical_size: (window_size * 0.75).as_uvec2(),
136                ..default()
137            }),
138            ..default()
139        },
140    ));
141
142    // Create a minimal UI explaining how to interact with the example
143    commands.spawn((
144        Text::new(
145            "Move the mouse to see the circle follow your cursor.\n\
146                    Use the arrow keys to move the camera.\n\
147                    Use the comma and period keys to zoom in and out.\n\
148                    Use the WASD keys to move the viewport.\n\
149                    Use the IJKL keys to resize the viewport.",
150        ),
151        Node {
152            position_type: PositionType::Absolute,
153            top: px(12),
154            left: px(12),
155            ..default()
156        },
157    ));
158
159    // Add mesh to make camera movement visible
160    commands.spawn((
161        Mesh2d(meshes.add(Rectangle::new(40.0, 20.0))),
162        MeshMaterial2d(materials.add(Color::from(GREEN))),
163    ));
164
165    // Add background to visualize viewport bounds
166    commands.spawn((
167        Mesh2d(meshes.add(Rectangle::new(50000.0, 50000.0))),
168        MeshMaterial2d(materials.add(Color::linear_rgb(0.01, 0.01, 0.01))),
169        Transform::from_translation(Vec3::new(0.0, 0.0, -200.0)),
170    ));
171}
examples/ui/render_ui_to_texture.rs (line 197)
174fn drive_diegetic_pointer(
175    mut cursor_last: Local<Vec2>,
176    mut raycast: MeshRayCast,
177    rays: Res<RayMap>,
178    cubes: Query<&Mesh3d, With<Cube>>,
179    ui_camera: Query<&Camera, With<Camera2d>>,
180    primary_window: Query<Entity, With<PrimaryWindow>>,
181    windows: Query<(Entity, &Window)>,
182    images: Res<Assets<Image>>,
183    manual_texture_views: Res<ManualTextureViews>,
184    mut window_events: MessageReader<WindowEvent>,
185    mut pointer_inputs: MessageWriter<PointerInput>,
186) -> Result {
187    // Get the size of the texture, so we can convert from dimensionless UV coordinates that span
188    // from 0 to 1, to pixel coordinates.
189    let target = ui_camera
190        .single()?
191        .target
192        .normalize(primary_window.single().ok())
193        .unwrap();
194    let target_info = target
195        .get_render_target_info(windows, &images, &manual_texture_views)
196        .unwrap();
197    let size = target_info.physical_size.as_vec2();
198
199    // Find raycast hits and update the virtual pointer.
200    let raycast_settings = MeshRayCastSettings {
201        visibility: RayCastVisibility::VisibleInView,
202        filter: &|entity| cubes.contains(entity),
203        early_exit_test: &|_| false,
204    };
205    for (_id, ray) in rays.iter() {
206        for (_cube, hit) in raycast.cast_ray(*ray, &raycast_settings) {
207            let position = size * hit.uv.unwrap();
208            if position != *cursor_last {
209                pointer_inputs.write(PointerInput::new(
210                    CUBE_POINTER_ID,
211                    Location {
212                        target: target.clone(),
213                        position,
214                    },
215                    PointerAction::Move {
216                        delta: position - *cursor_last,
217                    },
218                ));
219                *cursor_last = position;
220            }
221        }
222    }
223
224    // Pipe pointer button presses to the virtual pointer on the UI texture.
225    for window_event in window_events.read() {
226        if let WindowEvent::MouseButtonInput(input) = window_event {
227            let button = match input.button {
228                MouseButton::Left => PointerButton::Primary,
229                MouseButton::Right => PointerButton::Secondary,
230                MouseButton::Middle => PointerButton::Middle,
231                _ => continue,
232            };
233            let action = match input.state {
234                ButtonState::Pressed => PointerAction::Press(button),
235                ButtonState::Released => PointerAction::Release(button),
236            };
237            pointer_inputs.write(PointerInput::new(
238                CUBE_POINTER_ID,
239                Location {
240                    target: target.clone(),
241                    position: *cursor_last,
242                },
243                action,
244            ));
245        }
246    }
247
248    Ok(())
249}
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_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<&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 &u32

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 u32

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<UVec2> for &u32

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 u32

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

Source§

fn add_assign(&mut self, rhs: UVec2)

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

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

Source§

fn bitand_assign(&mut self, rhs: 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<&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

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

Source§

fn bitor_assign(&mut self, rhs: 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<&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

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

Source§

fn bitxor_assign(&mut self, rhs: UVec2)

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

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

Performs copy-assignment from source. Read more
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<&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 &u32

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 u32

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<UVec2> for &u32

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 u32

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

Source§

fn div_assign(&mut self, rhs: UVec2)

Performs the /= operation. Read more
Source§

impl From<[u32; 2]> for UVec2

Source§

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

Converts to this type from the input type.
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<U16Vec2> for UVec2

Source§

fn from(v: U16Vec2) -> 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<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 RenderTarget

Source§

fn from(value: UVec2) -> RenderTarget

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 WindowResolution

Source§

fn from(res: UVec2) -> WindowResolution

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<&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 &u32

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 u32

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<UVec2> for &u32

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 u32

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

Source§

fn mul_assign(&mut self, rhs: UVec2)

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

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

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

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

impl 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 debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Debug formatter for the value. Read more
Source§

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

Attempts to clone Self using reflection. Read more
Source§

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

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

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

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

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

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

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
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 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 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<&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 &u32

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 u32

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<UVec2> for &u32

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 u32

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

Source§

fn rem_assign(&mut self, rhs: UVec2)

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<&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 &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 &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 &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 &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 &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 &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 &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 &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 &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 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 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 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 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 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 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 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 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 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<&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<&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<&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<&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<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 &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 &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 &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 &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 &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 &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 &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 &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 &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 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 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 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 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 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 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 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 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<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 as Shl<i16>>::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<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<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 as Shl<i64>>::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<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<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 as Shl<u16>>::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<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<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 as Shl<u64>>::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<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 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 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<&i8> for UVec2

Source§

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

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<&u8> for UVec2

Source§

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

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

Source§

fn shl_assign(&mut self, rhs: i8)

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

Source§

fn shl_assign(&mut self, rhs: u8)

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 &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 &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 &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 &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 &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 &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 &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 &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 &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 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 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 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 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 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 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 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 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 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<&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<&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<&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<&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<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 &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 &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 &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 &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 &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 &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 &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 &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 &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 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 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 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 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 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 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 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 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<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 as Shr<i16>>::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<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<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 as Shr<i64>>::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<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<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 as Shr<u16>>::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<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<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 as Shr<u64>>::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<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 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 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<&i8> for UVec2

Source§

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

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<&u8> for UVec2

Source§

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

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

Source§

fn shr_assign(&mut self, rhs: i8)

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

Source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
Source§

impl Struct for UVec2

Source§

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

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

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

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

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

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

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

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

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

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

fn field_len(&self) -> usize

Returns the number of fields in the struct.
Source§

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

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

fn to_dynamic_struct(&self) -> DynamicStruct

Creates a new DynamicStruct from this struct.
Source§

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

Will return None if TypeInfo is not available.
Source§

impl 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 &u32

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 u32

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<UVec2> for &u32

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 u32

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

Source§

fn sub_assign(&mut self, rhs: UVec2)

Performs the -= operation. Read more
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 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 ToExtents for UVec2

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

Source§

impl Copy for UVec2

Source§

impl Eq for UVec2

Source§

impl Pod for UVec2

Source§

impl StructuralPartialEq for UVec2

Auto Trait Implementations§

§

impl Freeze for UVec2

§

impl RefUnwindSafe for UVec2

§

impl Send for UVec2

§

impl Sync for UVec2

§

impl Unpin 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, 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> 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> Conv for T

Source§

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

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

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

Source§

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

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

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

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

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

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

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

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

Source§

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

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

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

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

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

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

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

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

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

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

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

Source§

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

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

impl<T> 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<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

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

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

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

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

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

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

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

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

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

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

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

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

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

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

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

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

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

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

Source§

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

Creates Self using default().

Source§

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

Source§

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

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

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

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

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

Source§

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

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

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

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

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

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

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

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

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

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

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

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

type Type = T

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

impl<T> InitializeFromFunction<T> for T

Source§

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

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoResult<T> for T

Source§

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

Converts this type into the system output type.
Source§

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

Source§

fn into_sample(self) -> T

Source§

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

Source§

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

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

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

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

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

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

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

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

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

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<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<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

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

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

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

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

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

fn to_sample_(self) -> U

Source§

impl<T> 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> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> GpuArrayBufferable for T

Source§

impl<T> NoUninit for T
where T: Pod,

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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