pub struct FrozenFileCfg {
pub module_id: u8,
pub path: PathBuf,
pub buffer_size: usize,
pub initial_available_buffers: usize,
}Expand description
Config for FrozenFile
Fields§
§module_id: u8Identifier used for error propagation by [frozen_core::error::FrozenError]
path: PathBufAbsolute path for/of the file
NOTE: The caller must make sure that the path represents a file and all the parent directories included in the path do exists.
buffer_size: usizeSize (in bytes) of a single chunk in file
A chunk is a small fixed size allocation and addressing unit used by FrozenFile for all
the write/read ops. These ops are operated by index of the chunk and not the offset of the
byte.
NOTE: Chunk size when power of 2, is cache efficient and good for performance
initial_available_buffers: usizeNumber of chunks to pre-allocate on fs when FrozenFile is initialized
Initial file length will be buffer_size * initial_available_buffers (bytes).
Trait Implementations§
Source§impl Clone for FrozenFileCfg
impl Clone for FrozenFileCfg
Source§fn clone(&self) -> FrozenFileCfg
fn clone(&self) -> FrozenFileCfg
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FrozenFileCfg
impl RefUnwindSafe for FrozenFileCfg
impl Send for FrozenFileCfg
impl Sync for FrozenFileCfg
impl Unpin for FrozenFileCfg
impl UnsafeUnpin for FrozenFileCfg
impl UnwindSafe for FrozenFileCfg
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