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 with_format(self, format: FormatStrategy) -> Self
pub fn with_format(self, format: FormatStrategy) -> Self
Sourcepub fn with_extension(self, ext: impl Into<String>) -> Self
pub fn with_extension(self, ext: impl Into<String>) -> Self
Sourcepub fn with_filename_encoding(self, encoding: FilenameEncoding) -> Self
pub fn with_filename_encoding(self, encoding: FilenameEncoding) -> Self
Sourcepub fn with_retry_count(self, count: usize) -> Self
pub fn with_retry_count(self, count: usize) -> Self
Sourcepub fn with_cleanup(self, cleanup: bool) -> Self
pub fn with_cleanup(self, cleanup: bool) -> Self
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
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