pub struct View<'a>(/* private fields */);Expand description
Read-only typed view over a record 0x01 payload.
Implementations§
Source§impl<'a> View<'a>
impl<'a> View<'a>
Sourcepub fn new(payload: &'a [u8]) -> Result<Self>
pub fn new(payload: &'a [u8]) -> Result<Self>
§Errors
Rejects a payload shorter than the record.
pub fn bytes(&self) -> &'a [u8] ⓘ
pub fn u8(&self, at: usize) -> u8
pub fn u16_le(&self, at: usize) -> u16
pub fn f32_le(&self, at: usize) -> f32
pub fn module_width(&self) -> u16
Sourcepub fn module_height_stored(&self) -> u16
pub fn module_height_stored(&self) -> u16
The record stores half the module height.
pub fn scan(&self) -> u8
pub fn serial_clock(&self) -> u16
pub fn gray(&self) -> u8
pub fn luminance_level(&self) -> u16
pub fn max_width(&self) -> u16
pub fn max_height(&self) -> u16
Sourcepub fn grid(&self) -> (u16, u16)
pub fn grid(&self) -> (u16, u16)
The module-position grid unit (16x16 in practice), split across two byte pairs in the record.
Sourcepub fn split_segment(&self) -> u8
pub fn split_segment(&self) -> u8
Vendor GetSplitSegment from the +0x03E code.
pub fn min_oe(&self) -> f32
pub fn hr_scan_style(&self) -> u8
pub fn swap_ramp(&self) -> &'a [u8] ⓘ
pub fn chip_custom(&self) -> &'a [u8] ⓘ
pub fn chip_id(&self) -> u16
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for View<'a>
impl<'a> RefUnwindSafe for View<'a>
impl<'a> Send for View<'a>
impl<'a> Sync for View<'a>
impl<'a> Unpin for View<'a>
impl<'a> UnsafeUnpin for View<'a>
impl<'a> UnwindSafe for View<'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