IqdatRecord

Struct IqdatRecord 

Source
pub struct IqdatRecord {
    pub data: IndexMap<String, DmapField>,
}
Expand description

Struct containing the checked fields of a single IQDAT record.

Fields§

§data: IndexMap<String, DmapField>

Trait Implementations§

Source§

impl Clone for IqdatRecord

Source§

fn clone(&self) -> IqdatRecord

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IqdatRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for IqdatRecord

Source§

fn eq(&self, other: &IqdatRecord) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Record<'_> for IqdatRecord

Source§

fn inner(self) -> IndexMap<String, DmapField>

Gets the underlying data of self.
Source§

fn get(&self, key: &str) -> Option<&DmapField>

Returns the field with name key, if it exists in the record.
Source§

fn keys(&self) -> Vec<&String>

Returns the names of all fields stored in the record.
Source§

fn new( fields: &mut IndexMap<String, DmapField>, ) -> Result<IqdatRecord, DmapError>

Creates a new object from the parsed scalars and vectors.
Source§

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

Returns whether name is a metadata field of the record.
Source§

fn read_first_record(dmap_data: impl Read) -> Result<Self, DmapError>
where Self: Sized + Send,

Reads from dmap_data and parses into Vec<Self>. Read more
Source§

fn read_records(dmap_data: impl Read) -> Result<Vec<Self>, DmapError>
where Self: Sized + Send,

Reads from dmap_data and parses into Vec<Self>. Read more
Source§

fn read_metadata( dmap_data: impl Read, ) -> Result<Vec<IndexMap<String, DmapField>>, DmapError>
where Self: Sized + Send,

Reads metadata of records from dmap_data and parses into Vec<Self>. Read more
Source§

fn read_records_lax( dmap_data: impl Read, ) -> Result<(Vec<Self>, Option<usize>), DmapError>
where Self: Sized + Send,

Reads from dmap_data and parses into Vec<Self>. Read more
Source§

fn read_file<P: AsRef<Path>>(infile: P) -> Result<Vec<Self>, DmapError>
where Self: Sized + Send,

Read a DMAP file of type Self
Source§

fn read_file_lax<P: AsRef<Path>>( infile: P, ) -> Result<(Vec<Self>, Option<usize>), DmapError>
where Self: Sized + Send,

Read a DMAP file of type Self. Read more
Source§

fn sniff_file<P: AsRef<Path>>(infile: P) -> Result<Self, DmapError>
where Self: Sized + Send,

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>
where Self: Sized + Send,

Read the metadata from a DMAP file of type Self
Source§

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,

Reads a record from cursor.
Source§

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 more
Source§

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>

Converts the entries of an IndexMap into a raw byte representation, including metadata about the entries (DMAP key, name\[, dimensions\]). Read more
Source§

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 more
Source§

fn into_bytes(recs: &Vec<Self>) -> Result<Vec<u8>, DmapError>

Creates the byte represenation of a collection of Records. Read more
Source§

fn try_into_bytes( recs: Vec<IndexMap<String, DmapField>>, ) -> Result<Vec<u8>, DmapError>

Attempts to convert recs to Self then convert to bytes.
Source§

fn write_to_file<P: AsRef<Path>>( recs: &Vec<Self>, outfile: P, ) -> Result<(), DmapError>

Writes a collection of Records to outfile. Read more
Source§

impl TryFrom<&mut IndexMap<String, DmapField>> for IqdatRecord

Source§

type Error = DmapError

The type returned in the event of a conversion error.
Source§

fn try_from( value: &mut IndexMap<String, DmapField>, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<IndexMap<String, DmapField>> for IqdatRecord

Source§

type Error = DmapError

The type returned in the event of a conversion error.
Source§

fn try_from(value: IndexMap<String, DmapField>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for IqdatRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,