tof_dataclasses::io

Trait PacketReader

Source
pub trait PacketReader {
    const HEADER0: u8 = 0u8;
    const HEADER1: u8 = 0u8;

    // Required method
    fn set_cursor(&mut self, pos: usize);

    // Provided method
    fn rewind(&mut self) -> Result<()> { ... }
}
Expand description

Generics for packet reading (TofPacket, Telemetry packet,…) FIXME - not implemented yet

Provided Associated Constants§

Source

const HEADER0: u8 = 0u8

header bytes, e.g. 0xAAAA for TofPackets

Source

const HEADER1: u8 = 0u8

Required Methods§

Source

fn set_cursor(&mut self, pos: usize)

Manage the internal cursor attribute

Provided Methods§

Source

fn rewind(&mut self) -> Result<()>

Rewind the file, so it can be read again from the beginning

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§