pub struct RawDataElement {
    pub offset: u64,
    pub type_code: u64,
    pub raw_data: Vec<u8>,
    pub byte_order: ByteOrder,
}
Expand description

unprocessed STDF record data, contains:

  • offset
  • type_code
  • raw_data
  • byte_order

it can be converted back to StdfRecord

use rust_stdf::{RawDataElement, ByteOrder, StdfRecord, stdf_record_type::REC_FAR};

let rde = RawDataElement {
    offset: 0,
    type_code: 1,
    raw_data: vec![0u8; 0],
    byte_order: ByteOrder::LittleEndian
};
let rec: StdfRecord = (&rde).into();    // not consume
let rec: StdfRecord = rde.into();       // consume
println!("{:?}", rec);
assert!(rec.is_type(REC_FAR));

Fields

offset: u64

file offset of raw_data in file, after header.len and before raw_data

|-typ-|-sub-|–len–⬇️–raw..data–|

note that the offset is relative to the file position that runs get_rawdata_iter,

it can be treated as file position only if the iteration starts from beginning of the file.

type_code: u64

used for filtering and creating StdfRecord

raw_data: Vec<u8>

field data of current STDF Record

byte_order: ByteOrder

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

it will NOT consume the input RawDataElement

it will consume the input RawDataElement

This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.