pub struct InferenceContext<'a> {
pub aliases: &'a BTreeMap<String, String>,
pub is_matrix_cell: bool,
pub is_id_column: bool,
pub prev_row: Option<&'a [Value]>,
pub column_index: usize,
pub current_type: Option<&'a str>,
pub version: (u32, u32),
pub null_char: char,
pub expected_type: Option<ExpectedType>,
pub column_types: Option<&'a [ExpectedType]>,
pub strict_types: bool,
pub error_recovery: bool,
/* private fields */
}Expand description
Context for value inference.
P0 OPTIMIZATION: Pre-expanded alias cache for 3-4x speedup on alias-heavy documents
Fields§
§aliases: &'a BTreeMap<String, String>Alias definitions (original BTreeMap - kept for compatibility).
is_matrix_cell: boolWhether this is a matrix cell (enables ditto).
is_id_column: boolWhether this is the ID column.
prev_row: Option<&'a [Value]>Previous row values (for ditto).
column_index: usizeColumn index (for ditto).
current_type: Option<&'a str>Current type name (for reference resolution context).
version: (u32, u32)HEDL version (for version-specific validation).
null_char: charNull literal character (from %NULL directive, defaults to ‘~’).
expected_type: Option<ExpectedType>Expected type hint from schema or context.
column_types: Option<&'a [ExpectedType]>Column types for matrix rows.
strict_types: boolWhether to enforce strict type matching.
error_recovery: boolWhether to collect all errors or fail fast.
Implementations§
Source§impl<'a> InferenceContext<'a>
impl<'a> InferenceContext<'a>
Sourcepub fn for_key_value(aliases: &'a BTreeMap<String, String>) -> Self
pub fn for_key_value(aliases: &'a BTreeMap<String, String>) -> Self
Create context for key-value inference.
Sourcepub fn for_matrix_cell(
aliases: &'a BTreeMap<String, String>,
column_index: usize,
prev_row: Option<&'a [Value]>,
current_type: &'a str,
) -> Self
pub fn for_matrix_cell( aliases: &'a BTreeMap<String, String>, column_index: usize, prev_row: Option<&'a [Value]>, current_type: &'a str, ) -> Self
Create context for matrix cell inference.
Sourcepub fn with_version(self, version: (u32, u32)) -> Self
pub fn with_version(self, version: (u32, u32)) -> Self
Set the HEDL version for version-specific validation.
Sourcepub fn with_expected_type(self, expected: ExpectedType) -> Self
pub fn with_expected_type(self, expected: ExpectedType) -> Self
Set expected type hint.
Sourcepub fn with_column_types(self, types: &'a [ExpectedType]) -> Self
pub fn with_column_types(self, types: &'a [ExpectedType]) -> Self
Set column types for matrix inference.
Sourcepub fn with_strict_types(self, strict: bool) -> Self
pub fn with_strict_types(self, strict: bool) -> Self
Enable strict type matching.
Sourcepub fn with_error_recovery(self, recovery: bool) -> Self
pub fn with_error_recovery(self, recovery: bool) -> Self
Enable error recovery mode.
Sourcepub fn with_null_char(self, null_char: char) -> Self
pub fn with_null_char(self, null_char: char) -> Self
Set the null literal character (from %NULL directive).
Auto Trait Implementations§
impl<'a> Freeze for InferenceContext<'a>
impl<'a> RefUnwindSafe for InferenceContext<'a>
impl<'a> Send for InferenceContext<'a>
impl<'a> Sync for InferenceContext<'a>
impl<'a> Unpin for InferenceContext<'a>
impl<'a> UnwindSafe for InferenceContext<'a>
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> 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