pub struct MapRecord {
pub data: IndexMap<String, DmapField>,
}Expand description
Struct containing the checked fields of a single MAP record.
Fields§
§data: IndexMap<String, DmapField>Trait Implementations§
Source§impl Record<'_> for MapRecord
impl Record<'_> for MapRecord
Source§fn get(&self, key: &str) -> Option<&DmapField>
fn get(&self, key: &str) -> Option<&DmapField>
Returns the field with name
key, if it exists in the record.Source§fn new(fields: &mut IndexMap<String, DmapField>) -> Result<MapRecord, DmapError>
fn new(fields: &mut IndexMap<String, DmapField>) -> Result<MapRecord, DmapError>
Creates a new object from the parsed scalars and vectors.
Source§fn to_bytes(&self) -> Result<Vec<u8>, DmapError>
fn to_bytes(&self) -> Result<Vec<u8>, DmapError>
Attempts to copy
self to a raw byte representation.Source§fn is_metadata_field(name: &str) -> bool
fn is_metadata_field(name: &str) -> bool
Returns whether
name is a metadata field of the record.Source§fn read_metadata(
dmap_data: impl Read,
) -> Result<Vec<IndexMap<String, DmapField>>, DmapError>
fn read_metadata( dmap_data: impl Read, ) -> Result<Vec<IndexMap<String, DmapField>>, DmapError>
Source§fn read_records_lax(
dmap_data: impl Read,
) -> Result<(Vec<Self>, Option<usize>), DmapError>
fn read_records_lax( dmap_data: impl Read, ) -> Result<(Vec<Self>, Option<usize>), DmapError>
Source§fn read_file<P: AsRef<Path>>(infile: P) -> Result<Vec<Self>, DmapError>
fn read_file<P: AsRef<Path>>(infile: P) -> Result<Vec<Self>, DmapError>
Read a DMAP file of type
SelfSource§fn read_file_lax<P: AsRef<Path>>(
infile: P,
) -> Result<(Vec<Self>, Option<usize>), DmapError>
fn read_file_lax<P: AsRef<Path>>( infile: P, ) -> Result<(Vec<Self>, Option<usize>), DmapError>
Read a DMAP file of type
Self. Read moreSource§fn sniff_file<P: AsRef<Path>>(infile: P) -> Result<Self, DmapError>
fn sniff_file<P: AsRef<Path>>(infile: P) -> Result<Self, DmapError>
Reads the first record of a DMAP file of type
Self.Source§fn read_file_metadata<P: AsRef<Path>>(
infile: P,
) -> Result<Vec<IndexMap<String, DmapField>>, DmapError>
fn read_file_metadata<P: AsRef<Path>>( infile: P, ) -> Result<Vec<IndexMap<String, DmapField>>, DmapError>
Read the metadata from a DMAP file of type
SelfSource§fn parse_metadata(
cursor: &mut Cursor<Vec<u8>>,
) -> Result<IndexMap<String, DmapField>, DmapError>where
Self: Sized,
fn parse_metadata(
cursor: &mut Cursor<Vec<u8>>,
) -> Result<IndexMap<String, DmapField>, DmapError>where
Self: Sized,
Reads a record from
cursor, only keeping the metadata fields.Source§fn parse_record(cursor: &mut Cursor<Vec<u8>>) -> Result<Self, DmapError>where
Self: Sized,
fn parse_record(cursor: &mut Cursor<Vec<u8>>) -> Result<Self, DmapError>where
Self: Sized,
Reads a record from
cursor.Source§fn check_fields(
field_dict: &mut IndexMap<String, DmapField>,
fields_for_type: &Fields<'_>,
) -> Result<(), DmapError>
fn check_fields( field_dict: &mut IndexMap<String, DmapField>, fields_for_type: &Fields<'_>, ) -> Result<(), DmapError>
Checks the validity of an
IndexMap as a representation of a DMAP record. Read moreSource§fn coerce(
fields_dict: &mut IndexMap<String, DmapField>,
fields_for_type: &Fields<'_>,
) -> Result<Self, DmapError>
fn coerce( fields_dict: &mut IndexMap<String, DmapField>, fields_for_type: &Fields<'_>, ) -> Result<Self, DmapError>
Attempts to massage the entries of an
IndexMap into the proper types for a DMAP record.Source§fn data_to_bytes(
data: &IndexMap<String, DmapField>,
fields_for_type: &Fields<'_>,
) -> Result<(i32, i32, Vec<u8>), DmapError>
fn data_to_bytes( data: &IndexMap<String, DmapField>, fields_for_type: &Fields<'_>, ) -> Result<(i32, i32, Vec<u8>), DmapError>
Converts the entries of an
IndexMap into a raw byte representation, including metadata
about the entries (DMAP key, name\[, dimensions\]). Read moreSource§fn inspect_bytes(
&self,
fields_for_type: &Fields<'_>,
) -> Result<Vec<(String, usize, Vec<u8>)>, DmapError>
fn inspect_bytes( &self, fields_for_type: &Fields<'_>, ) -> Result<Vec<(String, usize, Vec<u8>)>, DmapError>
Converts the entries of a
Record into a raw byte representation, for debugging the conversion. Read moreimpl StructuralPartialEq for MapRecord
Auto Trait Implementations§
impl Freeze for MapRecord
impl RefUnwindSafe for MapRecord
impl Send for MapRecord
impl Sync for MapRecord
impl Unpin for MapRecord
impl UnwindSafe for MapRecord
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