Skip to main content

CiDataDevice

Trait CiDataDevice 

Source
pub trait CiDataDevice {
    // Required methods
    fn write(&mut self, ts: &[u8]) -> Result<()>;
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
    fn poll(&mut self, timeout: Duration) -> Result<bool>;
}
Expand description

The TS data-plane device of a separate-CI module (/dev/dvb/adapterN/ciM).

The host pushes scrambled TS in with write and pulls the descrambled TS out with read. Implementations: MockCiDataDevice (in-memory, for tests + differential harness) and, with the linux feature, a device over /dev/dvb/.../ci.

Required Methods§

Source

fn write(&mut self, ts: &[u8]) -> Result<()>

Write scrambled TS to the module. ts must be a whole number of TS_PACKET_LEN-byte packets.

Source

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Read descrambled TS into buf (sized to a multiple of TS_PACKET_LEN); returns the byte count. Ok(0) means none available (non-blocking).

Source

fn poll(&mut self, timeout: Duration) -> Result<bool>

Wait up to timeout for descrambled TS to become readable; Ok(true) if readable.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§