ArrangeSlice

Trait ArrangeSlice 

Source
pub trait ArrangeSlice<T: ShiftTransformExt>: AsMut<[T]> {
    // Provided methods
    fn arrange_with(&mut self, pos_func: impl Fn(usize) -> DVec3)
       where AabbPoint: Locate<T> { ... }
    fn arrange_in_y(&mut self, gap: f64)
       where T: Aabb,
             AabbPoint: Locate<T> { ... }
    fn arrange_in_grid(
        &mut self,
        cell_cnt: USizeVec3,
        cell_size: DVec3,
        gap: DVec3,
    ) -> &mut Self
       where AabbPoint: Locate<T> { ... }
    fn arrange_in_cols_with(
        &mut self,
        ncols: usize,
        pos_func: impl Fn(usize, usize) -> DVec3,
    )
       where AabbPoint: Locate<T> { ... }
    fn arrange_in_rows_with(
        &mut self,
        nrows: usize,
        pos_func: impl Fn(usize, usize) -> DVec3,
    )
       where AabbPoint: Locate<T> { ... }
}
Expand description

A trait for arranging operations.

Provided Methods§

Source

fn arrange_with(&mut self, pos_func: impl Fn(usize) -> DVec3)
where AabbPoint: Locate<T>,

Arrange the items by a given function.

The pos_func takes index as input and output the center position.

Source

fn arrange_in_y(&mut self, gap: f64)
where T: Aabb, AabbPoint: Locate<T>,

Arrange the items in a col

Source

fn arrange_in_grid( &mut self, cell_cnt: USizeVec3, cell_size: DVec3, gap: DVec3, ) -> &mut Self
where AabbPoint: Locate<T>,

Arrange the items in a grid.

Source

fn arrange_in_cols_with( &mut self, ncols: usize, pos_func: impl Fn(usize, usize) -> DVec3, )
where AabbPoint: Locate<T>,

Arrange the items in a grid with given number of columns.

The pos_func takes row and column index as input and output the center position.

Source

fn arrange_in_rows_with( &mut self, nrows: usize, pos_func: impl Fn(usize, usize) -> DVec3, )
where AabbPoint: Locate<T>,

Arrange the items in a grid with given number of rows.

The pos_func takes row and column index as input and output the center position.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§