Skip to main content

WriteConfig

Struct WriteConfig 

Source
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: Defaults

Default codec selection + inline threshold.

§categorizers: Vec<CategorizerConfig>

File categorizer rules (extension/magic → codec).

§chunking: ChunkingConfig

FastCDC chunking parameters.

§tournament: TournamentConfig

Compression tournament settings.

§codec_tunables: CodecTunables

Per-codec tunable parameters (memory budgets, quality levels).

§mode: ImageMode

Image mode: read-only archive or read-write filesystem.

§write_codec: String

Codec for incremental writes (RW mode only). Defaults to LZ4. During turnover, defaults.text_codec is used for re-compression.

§turnover_threshold: u32

Turnover threshold: number of history entries before automatic compaction triggers (RW mode only). 0 = manual turnover only.

§skip_chunking: bool

Skip FastCDC chunking; compress each file as a single drop. Trades dedup granularity for create speed. Recommended for max-write profile where speed >> ratio.

§encryption: EncryptionConfig

Encryption configuration.

§dictionaries: DictionaryConfig

ZSTD dictionary configuration.

Implementations§

Source§

impl WriteConfig

Source

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.

Source

pub fn to_toml(&self) -> Result<String, ConfigError>

Serialise to a TOML string.

§Errors

Returns ConfigError::TomlSer on serialisation errors.

Source

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

Source

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.

Source

pub fn from_profile(name: &str) -> Option<Self>

Load a built-in profile by name, then override fields via builder methods.

Source

pub fn with_text_codec(self, codec: &str) -> Self

Override the text codec.

Source

pub fn with_binary_codec(self, codec: &str) -> Self

Override the binary codec.

Source

pub fn with_chunk_size(self, size: u32) -> Self

Override the average chunk size.

Source

pub fn with_mode(self, mode: ImageMode) -> Self

Override the image mode (RO vs RW).

Source

pub fn with_brotli_quality(self, quality: u8) -> Self

Override Brotli quality.

Source

pub fn build(self) -> Result<Self, ConfigError>

Finalize (validate and return).

§Errors

Returns ConfigError on invalid configuration.

Source

pub fn validate(&self) -> Result<(), ConfigError>

Validate field relationships and range constraints.

§Errors

Returns a ConfigError on any invalid value.

Source

pub fn codec_registry(&self) -> Result<CodecRegistry, ConfigError>

Build the codec registry to use for this config. Maps codec names to numeric ids.

Source

pub fn text_codec_id(&self) -> Result<u8, ConfigError>

Resolve the default text codec id.

§Errors

Returns ConfigError if the codec name is unknown.

Source

pub fn binary_codec_id(&self) -> Result<u8, ConfigError>

Resolve the default binary codec id.

§Errors

Returns ConfigError if the codec name is unknown.

Source

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.

Source

pub fn metadata_codec_id(&self) -> Result<u8, ConfigError>

Resolve the default metadata codec id.

§Errors

Returns ConfigError if the codec name is unknown.

Trait Implementations§

Source§

impl Clone for WriteConfig

Source§

fn clone(&self) -> WriteConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WriteConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WriteConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for WriteConfig

Source§

impl PartialEq for WriteConfig

Source§

fn eq(&self, other: &WriteConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for WriteConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WriteConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.