Struct rust_stdf::RawDataElement
source · 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
sourceimpl Clone for RawDataElement
impl Clone for RawDataElement
sourcefn clone(&self) -> RawDataElement
fn clone(&self) -> RawDataElement
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for RawDataElement
impl Debug for RawDataElement
sourceimpl From<&RawDataElement> for StdfRecord
impl From<&RawDataElement> for StdfRecord
sourcefn from(raw_element: &RawDataElement) -> Self
fn from(raw_element: &RawDataElement) -> Self
it will NOT consume the input RawDataElement
sourceimpl From<RawDataElement> for StdfRecord
impl From<RawDataElement> for StdfRecord
sourcefn from(raw_element: RawDataElement) -> Self
fn from(raw_element: RawDataElement) -> Self
it will consume the input RawDataElement
sourceimpl PartialEq<RawDataElement> for RawDataElement
impl PartialEq<RawDataElement> for RawDataElement
sourcefn eq(&self, other: &RawDataElement) -> bool
fn eq(&self, other: &RawDataElement) -> bool
impl Eq for RawDataElement
impl StructuralEq for RawDataElement
impl StructuralPartialEq for RawDataElement
Auto Trait Implementations
impl RefUnwindSafe for RawDataElement
impl Send for RawDataElement
impl Sync for RawDataElement
impl Unpin for RawDataElement
impl UnwindSafe for RawDataElement
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more