pub struct Rcvbp {
pub version: u32,
pub records: Vec<Record>,
}Fields§
§version: u32§records: Vec<Record>Implementations§
Source§impl Rcvbp
impl Rcvbp
pub fn load(path: impl AsRef<Path>) -> Result<Self>
pub fn from_bytes(d: &[u8]) -> Result<Self>
pub fn find(&self, rtype: u16) -> Option<&Record>
Sourcepub fn geometry(&self) -> Option<(u16, u16)>
pub fn geometry(&self) -> Option<(u16, u16)>
Cabinet geometry from the 0x0aca record: (width, scan). Panel height is not stored directly; it is scan * data groups.
Sourcepub fn main_geometry(&self) -> Option<(u8, u8)>
pub fn main_geometry(&self) -> Option<(u8, u8)>
Width/scan from the main 0x0a01 parameter block: (width, scan).
Sourcepub fn find_by_id(&self, id: u8) -> Option<&Record>
pub fn find_by_id(&self, id: u8) -> Option<&Record>
The first record with this id byte, whatever container marker it
carries (see Record::id).
Sourcepub fn scan(&self) -> Option<u8>
pub fn scan(&self) -> Option<u8>
Scan denominator (16, 32, 64) at record 0x01 +0x020. The byte at +0x001 is stored module height, not scan.
pub fn find_mut(&mut self, rtype: u16) -> Option<&mut Record>
Sourcepub fn upsert(&mut self, rtype: u16, payload: Vec<u8>)
pub fn upsert(&mut self, rtype: u16, payload: Vec<u8>)
Replace a record’s payload, or append the record if absent.
New records are inserted before the trailing geometry record when there is one, matching where vendor files place them.
pub fn remove(&mut self, rtype: u16) -> bool
Sourcepub fn to_blob(&self) -> Result<Vec<u8>>
pub fn to_blob(&self) -> Result<Vec<u8>>
Serialise the records back into a record stream.
§Errors
Fails if a record is too large for the 16-bit length field.
Trait Implementations§
impl Eq for Rcvbp
impl StructuralPartialEq for Rcvbp
Auto Trait Implementations§
impl Freeze for Rcvbp
impl RefUnwindSafe for Rcvbp
impl Send for Rcvbp
impl Sync for Rcvbp
impl Unpin for Rcvbp
impl UnsafeUnpin for Rcvbp
impl UnwindSafe for Rcvbp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.