pub struct DirStorageStrategy {
pub format: FormatStrategy,
pub atomic_write: AtomicWriteConfig,
pub extension: Option<String>,
pub filename_encoding: FilenameEncoding,
}Expand description
Strategy configuration for directory-based storage operations.
Fields§
§format: FormatStrategyFile format to use for serialisation (JSON or TOML).
atomic_write: AtomicWriteConfigAtomic write configuration (retry count, temp-file cleanup).
extension: Option<String>Custom file extension. When None the extension is derived from
format ("json" or "toml").
filename_encoding: FilenameEncodingFilename encoding strategy for entity IDs.
Implementations§
Source§impl DirStorageStrategy
impl DirStorageStrategy
Sourcepub fn new() -> DirStorageStrategy
pub fn new() -> DirStorageStrategy
Create a new strategy with default values.
Sourcepub fn with_format(self, format: FormatStrategy) -> DirStorageStrategy
pub fn with_format(self, format: FormatStrategy) -> DirStorageStrategy
Sourcepub fn with_extension(self, ext: impl Into<String>) -> DirStorageStrategy
pub fn with_extension(self, ext: impl Into<String>) -> DirStorageStrategy
Sourcepub fn with_filename_encoding(
self,
encoding: FilenameEncoding,
) -> DirStorageStrategy
pub fn with_filename_encoding( self, encoding: FilenameEncoding, ) -> DirStorageStrategy
Sourcepub fn with_retry_count(self, count: usize) -> DirStorageStrategy
pub fn with_retry_count(self, count: usize) -> DirStorageStrategy
Sourcepub fn with_cleanup(self, cleanup: bool) -> DirStorageStrategy
pub fn with_cleanup(self, cleanup: bool) -> DirStorageStrategy
Sourcepub fn get_extension(&self) -> String
pub fn get_extension(&self) -> String
Returns the effective file extension for this strategy.
Uses self.extension when set; otherwise derives "json" or "toml"
from self.format.
Trait Implementations§
Source§impl Clone for DirStorageStrategy
impl Clone for DirStorageStrategy
Source§fn clone(&self) -> DirStorageStrategy
fn clone(&self) -> DirStorageStrategy
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 moreSource§impl Debug for DirStorageStrategy
impl Debug for DirStorageStrategy
Source§impl Default for DirStorageStrategy
impl Default for DirStorageStrategy
Source§fn default() -> DirStorageStrategy
fn default() -> DirStorageStrategy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DirStorageStrategy
impl RefUnwindSafe for DirStorageStrategy
impl Send for DirStorageStrategy
impl Sync for DirStorageStrategy
impl Unpin for DirStorageStrategy
impl UnsafeUnpin for DirStorageStrategy
impl UnwindSafe for DirStorageStrategy
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