pub struct ChunkingConfig {
pub chunk_dims: Vec<usize>,
}Expand description
Chunking configuration for a dataset.
Fields§
§chunk_dims: Vec<usize>Chunk dimensions. Must have the same number of dimensions as the dataset.
Implementations§
Source§impl ChunkingConfig
impl ChunkingConfig
Sourcepub fn new(chunk_dims: Vec<usize>) -> Self
pub fn new(chunk_dims: Vec<usize>) -> Self
Create a chunking config with the given chunk dimensions.
Sourcepub fn n_chunks(&self, shape: &[usize]) -> usize
pub fn n_chunks(&self, shape: &[usize]) -> usize
Compute the number of chunks needed for a dataset with the given shape.
Sourcepub fn chunk_index(&self, element_idx: &[usize], shape: &[usize]) -> usize
pub fn chunk_index(&self, element_idx: &[usize], shape: &[usize]) -> usize
Compute the linear index of the chunk containing the given element.
Sourcepub fn default_for_shape(shape: &[usize]) -> Self
pub fn default_for_shape(shape: &[usize]) -> Self
Default chunking: chunk size of 64 in each dimension.
Trait Implementations§
Source§impl Clone for ChunkingConfig
impl Clone for ChunkingConfig
Source§fn clone(&self) -> ChunkingConfig
fn clone(&self) -> ChunkingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChunkingConfig
impl RefUnwindSafe for ChunkingConfig
impl Send for ChunkingConfig
impl Sync for ChunkingConfig
impl Unpin for ChunkingConfig
impl UnsafeUnpin for ChunkingConfig
impl UnwindSafe for ChunkingConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.