pub struct UnknownFields { /* private fields */ }Expand description
Container for unknown/unrecognized fields during parsing.
When parsing a record, any parameters that are not explicitly handled by the record type are collected here. During serialization, these unknown fields are written back, preserving the original file content.
Implementations§
Source§impl UnknownFields
impl UnknownFields
Sourcepub fn from_remaining_params(
original: &ParameterCollection,
known_keys: &[&str],
) -> Self
pub fn from_remaining_params( original: &ParameterCollection, known_keys: &[&str], ) -> Self
Create from remaining parameters after known fields have been extracted.
This compares the original parameter collection against a list of known keys, collecting any parameters that weren’t in the known list.
Sourcepub fn from_remaining_params_with_prefixes(
original: &ParameterCollection,
known_keys: &[&str],
indexed_prefixes: &[&str],
) -> Self
pub fn from_remaining_params_with_prefixes( original: &ParameterCollection, known_keys: &[&str], indexed_prefixes: &[&str], ) -> Self
Create from remaining parameters with indexed prefix exclusion.
In addition to exact key matching, this method also excludes any parameters that start with the given prefixes followed by a digit (e.g., “X1”, “X2” for prefix “X”).
Sourcepub fn from_remaining_binary(data: Vec<u8>) -> Self
pub fn from_remaining_binary(data: Vec<u8>) -> Self
Create from remaining binary bytes.
Sourcepub fn merge_into_params(&self, params: &mut ParameterCollection)
pub fn merge_into_params(&self, params: &mut ParameterCollection)
Merge unknown parameters back into a parameter collection.
Parameters are written in their original order to preserve file structure as much as possible.
Sourcepub fn binary_data(&self) -> &[u8] ⓘ
pub fn binary_data(&self) -> &[u8] ⓘ
Get the unknown binary data.
Sourcepub fn binary_data_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn binary_data_mut(&mut self) -> &mut Vec<u8> ⓘ
Get mutable access to the unknown binary data.
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Get count of unknown parameters.
Sourcepub fn binary_count(&self) -> usize
pub fn binary_count(&self) -> usize
Get count of unknown binary bytes.
Sourcepub fn unknown_param_names(&self) -> &[String]
pub fn unknown_param_names(&self) -> &[String]
Get list of unknown parameter names (for debugging/logging).
Sourcepub fn remove_param(&mut self, key: &str) -> bool
pub fn remove_param(&mut self, key: &str) -> bool
Remove an unknown parameter.
Trait Implementations§
Source§impl Clone for UnknownFields
impl Clone for UnknownFields
Source§fn clone(&self) -> UnknownFields
fn clone(&self) -> UnknownFields
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UnknownFields
impl Debug for UnknownFields
Source§impl Default for UnknownFields
impl Default for UnknownFields
Source§fn default() -> UnknownFields
fn default() -> UnknownFields
Auto Trait Implementations§
impl Freeze for UnknownFields
impl RefUnwindSafe for UnknownFields
impl Send for UnknownFields
impl Sync for UnknownFields
impl Unpin for UnknownFields
impl UnwindSafe for UnknownFields
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,
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