pub struct DataRecord {
pub fields: HashMap<String, Value>,
pub record_key: Option<String>,
}Expand description
Represents a single row of extracted data from a TextFSM template.
Fields§
§fields: HashMap<String, Value>Map of value names to their extracted values.
record_key: Option<String>An optional key used to identify the record, constructed from fields marked as ‘Key’.
Implementations§
Source§impl DataRecord
impl DataRecord
Sourcepub fn overwrite_from(&mut self, from: DataRecord)
pub fn overwrite_from(&mut self, from: DataRecord)
Overwrites existing fields in this record with fields from another record.
Sourcepub fn compare_sets(
result: &[Self],
other: &[Self],
) -> (Vec<Vec<String>>, Vec<Vec<String>>)
pub fn compare_sets( result: &[Self], other: &[Self], ) -> (Vec<Vec<String>>, Vec<Vec<String>>)
Compares two sets of records and returns differences. Returns a tuple of (fields only in result, fields only in other).
Sourcepub fn insert(&mut self, name: String, value: String)
pub fn insert(&mut self, name: String, value: String)
Inserts a single string value into the record. If the key already exists, it converts the value to a list or appends to it.
Sourcepub fn append_value(&mut self, name: String, value: Value)
pub fn append_value(&mut self, name: String, value: Value)
Appends a Value to the record.
Trait Implementations§
Source§impl Clone for DataRecord
impl Clone for DataRecord
Source§fn clone(&self) -> DataRecord
fn clone(&self) -> DataRecord
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 DataRecord
impl Debug for DataRecord
Source§impl Default for DataRecord
impl Default for DataRecord
Source§fn default() -> DataRecord
fn default() -> DataRecord
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DataRecord
impl<'de> Deserialize<'de> for DataRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for DataRecord
impl PartialEq for DataRecord
Source§impl Serialize for DataRecord
impl Serialize for DataRecord
impl StructuralPartialEq for DataRecord
Auto Trait Implementations§
impl Freeze for DataRecord
impl RefUnwindSafe for DataRecord
impl Send for DataRecord
impl Sync for DataRecord
impl Unpin for DataRecord
impl UnwindSafe for DataRecord
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