#[non_exhaustive]pub enum PreallocateMode {
None,
Zero,
FormatAllocate,
FullAllocate,
WriteData,
}Expand description
Format layer preallocation modes.
When resizing or create an image, this mode determines whether and how the new data range is to be preallocated.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
No preallocation.
Reading the new range may return random data.
Zero
Ensure range reads as zeroes.
Does not necessarily allocate data, but has to ensure the new range will read back as zeroes (e.g. a backing file’s contents must not show through).
FormatAllocate
Metadata preallocation.
Do not write data, but ensure all blocks are mapped as data. For images without a backing file, that data must read as zeroes. For images with a backing file, that data must be the same as the backing file’s contents, and zeroes beyond the backing file EOF.
FullAllocate
Metadata and extent preallocation.
Same as FormatAllocate, but also allocate all blocks on the underlying storage.
WriteData
Full data preallocation.
Write data to the whole range. For images without a backing file, that data must read as zeroes. For images with a backing file, that data must be the same as the backing file’s contents, and zeroes beyond the backing file EOF.
Trait Implementations§
Source§impl Clone for PreallocateMode
impl Clone for PreallocateMode
Source§fn clone(&self) -> PreallocateMode
fn clone(&self) -> PreallocateMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more