Skip to main content

Formats

Trait Formats 

Source
pub trait Formats {
    // Required method
    fn headers(&self, signature: u16) -> Option<&[u8]>;
}
Expand description

Where compact frames find their layouts.

Fill it only from frames you trust at least as much as the compact frames it will serve. A CRC-16 signature is not a MAC: anyone in radio range can send a format frame or a plaintext full frame whose layout collides with a genuine one and re-reads the same data bytes as other records with a matching full-frame CRC. Expanded records are only as trustworthy as the frame their layout came from: for an authenticated or decrypted compact frame, learn layouts from that meter’s decrypted full frames only (004-compact-and-fragments/SR-001).

Required Methods§

Source

fn headers(&self, signature: u16) -> Option<&[u8]>

The DIF/VIF bytes for signature, if known.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Formats for [Format<'_>]

Source§

fn headers(&self, signature: u16) -> Option<&[u8]>

Source§

impl<F: Formats + ?Sized> Formats for &F

Source§

fn headers(&self, signature: u16) -> Option<&[u8]>

Implementors§

Source§

impl Formats for Format<'_>

Source§

impl<const N: usize, const B: usize> Formats for FormatCache<N, B>