pub struct PTRView<'a> { /* private fields */ }Expand description
Zero-copy view over the field data of a PTR record.
Borrows the raw bytes and reads fields on demand via getters. Create one with Self::new or via [StdfRecordView::read_from_bytes]; convert back to an owned PTR with Self::to_owned.
Implementations§
Source§impl<'a> PTRView<'a>
impl<'a> PTRView<'a>
Sourcepub fn new(raw: &'a [u8], order: &ByteOrder) -> Self
pub fn new(raw: &'a [u8], order: &ByteOrder) -> Self
Scan the given raw data and store byte offset of each field.
pub fn test_num(&self) -> U4
pub fn head_num(&self) -> U1
pub fn site_num(&self) -> U1
pub fn test_flg(&self) -> B1
pub fn parm_flg(&self) -> B1
pub fn result(&self) -> R4
pub fn test_txt(&self) -> CnRef<'a>
pub fn alarm_id(&self) -> CnRef<'a>
pub fn opt_flag(&self) -> Option<B1>
pub fn res_scal(&self) -> Option<I1>
pub fn llm_scal(&self) -> Option<I1>
pub fn hlm_scal(&self) -> Option<I1>
pub fn lo_limit(&self) -> Option<R4>
pub fn hi_limit(&self) -> Option<R4>
pub fn units(&self) -> Option<CnRef<'a>>
pub fn c_resfmt(&self) -> Option<CnRef<'a>>
pub fn c_llmfmt(&self) -> Option<CnRef<'a>>
pub fn c_hlmfmt(&self) -> Option<CnRef<'a>>
pub fn lo_spec(&self) -> Option<R4>
pub fn hi_spec(&self) -> Option<R4>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PTRView<'a>
impl<'a> RefUnwindSafe for PTRView<'a>
impl<'a> Send for PTRView<'a>
impl<'a> Sync for PTRView<'a>
impl<'a> Unpin for PTRView<'a>
impl<'a> UnsafeUnpin for PTRView<'a>
impl<'a> UnwindSafe for PTRView<'a>
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