StrictDeterministicConfig

Struct StrictDeterministicConfig 

Source
pub struct StrictDeterministicConfig {
    pub reject_unsorted_fields: bool,
    pub require_type_hints: bool,
    pub canonical_boolean: bool,
    pub canonical_string: bool,
    pub min_binary_version: u8,
    pub validate_binary_ordering: bool,
}
Expand description

Configuration for strict deterministic behavior

Controls validation and canonicalization requirements for parsing and encoding LNMP data.

Fields§

§reject_unsorted_fields: bool

Reject records with unsorted fields

When true, parsing will fail if fields are not in ascending FID order.

§require_type_hints: bool

Require type hints on all fields

When true, parsing will fail if any field lacks a type hint.

§canonical_boolean: bool

Enforce canonical boolean representation (0/1 only)

When true, parsing will fail for non-canonical boolean values (e.g., “true”, “false”, “yes”, “no”).

§canonical_string: bool

Enforce canonical string normalization

When true, strings are normalized (trimmed, case-folded if configured).

§min_binary_version: u8

Minimum binary format version

Reject binary data with version lower than this.

  • 0x04: v0.4 (no nested structures)
  • 0x05: v0.5 (nested structures supported)
§validate_binary_ordering: bool

Validate field ordering in binary format

When true, binary decoder validates that fields are in ascending FID order.

Implementations§

Source§

impl StrictDeterministicConfig

Source

pub fn strict() -> Self

Creates config for strict deterministic mode (v0.5-D)

Maximum strictness for LLM drift prevention:

  • All validations enabled
  • Type hints required
  • Canonical forms enforced
  • Minimum binary version 0x05
§Example
use lnmp_core::profile::StrictDeterministicConfig;

let config = StrictDeterministicConfig::strict();
assert!(config.reject_unsorted_fields);
assert!(config.require_type_hints);
assert!(config.canonical_boolean);
assert_eq!(config.min_binary_version, 0x05);
Source

pub fn standard() -> Self

Creates config for standard mode

Balanced approach:

  • Canonical output but accepts non-canonical input
  • Type hints optional
  • Binary v0.4 compatible
§Example
use lnmp_core::profile::StrictDeterministicConfig;

let config = StrictDeterministicConfig::standard();
assert!(!config.reject_unsorted_fields);
assert!(!config.require_type_hints);
assert!(config.canonical_boolean); // Still normalize output
Source

pub fn loose() -> Self

Creates config for loose mode

Maximum backward compatibility:

  • All validations disabled
  • Accepts any input
§Example
use lnmp_core::profile::StrictDeterministicConfig;

let config = StrictDeterministicConfig::loose();
assert!(!config.reject_unsorted_fields);
assert!(!config.require_type_hints);
assert!(!config.canonical_boolean);
Source

pub fn is_strict(&self) -> bool

Returns whether this config enforces strict determinism

Source

pub fn profile(&self) -> LnmpProfile

Returns the recommended profile for this config

Trait Implementations§

Source§

impl Clone for StrictDeterministicConfig

Source§

fn clone(&self) -> StrictDeterministicConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for StrictDeterministicConfig

Source§

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

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

impl Default for StrictDeterministicConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for StrictDeterministicConfig

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for StrictDeterministicConfig

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> 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> 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.