pub struct RegionOptions { /* private fields */ }Expand description
A region’s size, and the most it may ever grow to.
use store_io_engine::RegionOptions;
// 64 MiB now, never more than 1 GiB: one extent of 1 GiB, so the
// region grows to its cap without new space or a second extent.
let opts = RegionOptions::default().size(64 << 20).max_size(1 << 30);
assert!(opts.validate().is_ok());
assert!(RegionOptions::default().size(2).max_size(1).validate().is_err());Implementations§
Source§impl RegionOptions
impl RegionOptions
Sourcepub const fn size(self, bytes: u64) -> Self
pub const fn size(self, bytes: u64) -> Self
The data size to provision, in bytes (rounded up to the block; a page or append region holds at least one block).
Sourcepub const fn max_size(self, bytes: u64) -> Self
pub const fn max_size(self, bytes: u64) -> Self
The most the region may ever grow to, in bytes (rounded up to the
block). Container format 2 only: the region is placed as one extent
of this capacity (its space held from the start, charged to its tag)
and grows within it, one run, with no new space; growth past it is
NoSpace(RegionLimit). Without it a region grows by new extents
while the container has room.
The space past the size is allocated, not written, where the system can (Linux); on Windows and macOS it is written at provisioning (a 64 GiB cap is a 64 GiB write, during which other provisioning and space reports wait), and each growth within it writes its range again (as everywhere).
Sourcepub const fn size_bytes(&self) -> u64
pub const fn size_bytes(&self) -> u64
The data size asked for.
Sourcepub const fn max_size_bytes(&self) -> Option<u64>
pub const fn max_size_bytes(&self) -> Option<u64>
The cap asked for, if any.