pub struct DirectoryConfig {
pub write_key: String,
pub storage_location: PathBuf,
pub base_filename: String,
pub max_file_size: usize,
}Expand description
Configuration options for the file-based data store.
This struct provides the configuration parameters needed to create a new DirectoryStore instance. It controls where and how files are stored, including file naming, size limits, and organization.
§Examples
use std::path::PathBuf;
use transientdb::DirectoryConfig;
let config = DirectoryConfig {
write_key: "my-store".into(),
storage_location: PathBuf::from("/tmp/data"),
base_filename: "events".into(),
max_file_size: 1024 * 1024, // 1MB
};Fields§
§write_key: StringKey used to identify writes to this store. This is included in the metadata of each data file created by the store.
storage_location: PathBufDirectory where data files will be stored. The store will create this directory if it doesn’t exist.
base_filename: StringBase name for generated files. Files will be created with the pattern: “{index}-{base_filename}” where index is an auto-incrementing number.
max_file_size: usizeMaximum size in bytes for individual data files. Once a file reaches this size, a new file will be created. Must be at least 100 bytes.
Trait Implementations§
Source§impl Clone for DirectoryConfig
impl Clone for DirectoryConfig
Source§fn clone(&self) -> DirectoryConfig
fn clone(&self) -> DirectoryConfig
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 DirectoryConfig
impl RefUnwindSafe for DirectoryConfig
impl Send for DirectoryConfig
impl Sync for DirectoryConfig
impl Unpin for DirectoryConfig
impl UnwindSafe for DirectoryConfig
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