pub trait ResizeLayout: MutLayout {
// Required methods
fn insert_axis(&mut self, index: usize);
fn remove_axis_of_any_size(&mut self, index: usize);
fn merge_axes(&mut self);
// Provided method
fn remove_axis(&mut self, index: usize) { ... }
}
Expand description
Required Methods§
Sourcefn insert_axis(&mut self, index: usize)
fn insert_axis(&mut self, index: usize)
Insert a size-one axis at the given index in the shape. This will have the same stride as the dimension that follows it.
Sourcefn remove_axis_of_any_size(&mut self, index: usize)
fn remove_axis_of_any_size(&mut self, index: usize)
Remove an axis that may have any size.
If the size of the axis is not one, this will “remove” elements from the layout.
Sourcefn merge_axes(&mut self)
fn merge_axes(&mut self)
Merge consecutive axes where possible.
This “simplifies” the layout by minimizing the number of dimensions while preserving the iteration order.
Provided Methods§
Sourcefn remove_axis(&mut self, index: usize)
fn remove_axis(&mut self, index: usize)
Remove a size-1 axis at the given index.
Since the axis has size one, this does not alter the number of elements in the layout or the order in which they are visited.
Panics if the axis does not have a size of 1.
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.