pub struct GenericRecord { /* private fields */ }Expand description
A record with dynamic field access for parameter format.
Preserves original field order and tracks modifications for non-destructive round-trip editing.
Implementations§
Source§impl GenericRecord
impl GenericRecord
Sourcepub fn from_params(params: &ParameterCollection) -> Self
pub fn from_params(params: &ParameterCollection) -> Self
Creates a GenericRecord from a ParameterCollection.
Sourcepub fn get_or<'a>(&'a self, key: &str, default: &'a Value) -> &'a Value
pub fn get_or<'a>(&'a self, key: &str, default: &'a Value) -> &'a Value
Gets a field value with a default.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
Iterates over all fields in original order.
Sourcepub fn set(&mut self, key: &str, value: impl Into<Value>)
pub fn set(&mut self, key: &str, value: impl Into<Value>)
Sets a field value, preserving position if it exists.
Sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
Returns true if any fields were modified.
Sourcepub fn modified_fields(&self) -> Vec<&str>
pub fn modified_fields(&self) -> Vec<&str>
Returns the names of modified fields.
Sourcepub fn to_params(&self) -> ParameterCollection
pub fn to_params(&self) -> ParameterCollection
Converts back to a ParameterCollection.
Sourcepub fn to_params_string(&self) -> String
pub fn to_params_string(&self) -> String
Converts to a parameter string.
Sourcepub fn owner_index(&self) -> i32
pub fn owner_index(&self) -> i32
Gets the owner index (OWNERINDEX parameter).
Sourcepub fn set_owner_index(&mut self, index: i32)
pub fn set_owner_index(&mut self, index: i32)
Sets the owner index.
Trait Implementations§
Source§impl Clone for GenericRecord
impl Clone for GenericRecord
Source§fn clone(&self) -> GenericRecord
fn clone(&self) -> GenericRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenericRecord
impl Debug for GenericRecord
Source§impl Default for GenericRecord
impl Default for GenericRecord
Auto Trait Implementations§
impl Freeze for GenericRecord
impl RefUnwindSafe for GenericRecord
impl Send for GenericRecord
impl Sync for GenericRecord
impl Unpin for GenericRecord
impl UnwindSafe for GenericRecord
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
Mutably borrows from an owned value. Read more
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>
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 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>
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