pub struct WriteConfig {
pub defaults: Defaults,
pub categorizers: Vec<CategorizerConfig>,
pub chunking: ChunkingConfig,
pub tournament: TournamentConfig,
pub codec_tunables: CodecTunables,
pub mode: ImageMode,
pub write_codec: String,
pub turnover_threshold: u32,
pub skip_chunking: bool,
pub encryption: EncryptionConfig,
pub dictionaries: DictionaryConfig,
}Expand description
Top-level write configuration. All fields are public so the
TOML loader can construct values directly; runtime validation
lives in WriteConfig::validate.
Fields§
§defaults: DefaultsDefault codec selection + inline threshold.
categorizers: Vec<CategorizerConfig>File categorizer rules (extension/magic → codec).
chunking: ChunkingConfigFastCDC chunking parameters.
tournament: TournamentConfigCompression tournament settings.
codec_tunables: CodecTunablesPer-codec tunable parameters (memory budgets, quality levels).
mode: ImageModeImage mode: read-only archive or read-write filesystem.
write_codec: StringCodec for incremental writes (RW mode only). Defaults to LZ4.
During turnover, defaults.text_codec is used for re-compression.
turnover_threshold: u32Turnover threshold: number of history entries before automatic compaction triggers (RW mode only). 0 = manual turnover only.
skip_chunking: boolSkip FastCDC chunking; compress each file as a single drop.
Trades dedup granularity for create speed. Recommended for
max-write profile where speed >> ratio.
encryption: EncryptionConfigEncryption configuration.
dictionaries: DictionaryConfigZSTD dictionary configuration.
Implementations§
Source§impl WriteConfig
impl WriteConfig
Sourcepub fn from_toml(path: &Path) -> Result<Self, ConfigError>
pub fn from_toml(path: &Path) -> Result<Self, ConfigError>
Load a config from a TOML file.
§Errors
Returns ConfigError::Io on read errors, ConfigError::Toml
on parse errors, or ConfigError::InvalidValue on validation
errors.
Sourcepub fn to_toml(&self) -> Result<String, ConfigError>
pub fn to_toml(&self) -> Result<String, ConfigError>
Sourcepub fn write_to_toml(&self, path: &Path) -> Result<(), ConfigError>
pub fn write_to_toml(&self, path: &Path) -> Result<(), ConfigError>
Write a serialised config to a file.
§Errors
Returns ConfigError::Io on write errors or ConfigError::TomlSer
on serialisation errors.
Source§impl WriteConfig
impl WriteConfig
Sourcepub fn default_v0_1() -> Self
pub fn default_v0_1() -> Self
Create the v0.1-compatible default configuration.
All fields match the behavior of limnifs-write before
this config was introduced.
Sourcepub fn from_profile(name: &str) -> Option<Self>
pub fn from_profile(name: &str) -> Option<Self>
Load a built-in profile by name, then override fields via builder methods.
Sourcepub fn with_text_codec(self, codec: &str) -> Self
pub fn with_text_codec(self, codec: &str) -> Self
Override the text codec.
Sourcepub fn with_binary_codec(self, codec: &str) -> Self
pub fn with_binary_codec(self, codec: &str) -> Self
Override the binary codec.
Sourcepub fn with_chunk_size(self, size: u32) -> Self
pub fn with_chunk_size(self, size: u32) -> Self
Override the average chunk size.
Sourcepub fn with_brotli_quality(self, quality: u8) -> Self
pub fn with_brotli_quality(self, quality: u8) -> Self
Override Brotli quality.
Sourcepub fn build(self) -> Result<Self, ConfigError>
pub fn build(self) -> Result<Self, ConfigError>
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate field relationships and range constraints.
§Errors
Returns a ConfigError on any invalid value.
Sourcepub fn codec_registry(&self) -> Result<CodecRegistry, ConfigError>
pub fn codec_registry(&self) -> Result<CodecRegistry, ConfigError>
Build the codec registry to use for this config. Maps codec names to numeric ids.
Sourcepub fn text_codec_id(&self) -> Result<u8, ConfigError>
pub fn text_codec_id(&self) -> Result<u8, ConfigError>
Sourcepub fn binary_codec_id(&self) -> Result<u8, ConfigError>
pub fn binary_codec_id(&self) -> Result<u8, ConfigError>
Sourcepub fn to_core_tunables(&self) -> CodecTunables
pub fn to_core_tunables(&self) -> CodecTunables
Build the codec-agnostic limnifs_core::codec::CodecTunables
view of this config’s per-codec knobs. Used by the parallel
writer to honour PPMd order/budget, Brotli quality, ZSTD
level, Bzip2 block size — anything else falls back to codec
defaults.
Sourcepub fn metadata_codec_id(&self) -> Result<u8, ConfigError>
pub fn metadata_codec_id(&self) -> Result<u8, ConfigError>
Trait Implementations§
Source§impl Clone for WriteConfig
impl Clone for WriteConfig
Source§fn clone(&self) -> WriteConfig
fn clone(&self) -> WriteConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WriteConfig
impl Debug for WriteConfig
Source§impl<'de> Deserialize<'de> for WriteConfig
impl<'de> Deserialize<'de> for WriteConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for WriteConfig
Source§impl PartialEq for WriteConfig
impl PartialEq for WriteConfig
Source§impl Serialize for WriteConfig
impl Serialize for WriteConfig
impl StructuralPartialEq for WriteConfig
Auto Trait Implementations§
impl Freeze for WriteConfig
impl RefUnwindSafe for WriteConfig
impl Send for WriteConfig
impl Sync for WriteConfig
impl Unpin for WriteConfig
impl UnsafeUnpin for WriteConfig
impl UnwindSafe for WriteConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more