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§
Sourcefn write(&mut self, ts: &[u8]) -> Result<()>
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.
An implementation must never leave a packet half written. When the
device cannot take all of ts (its buffer is full) it returns an
io::ErrorKind::WouldBlock error carrying a PartialWrite — read
it with partial_write_progress — whose written is the number of
whole-packet bytes the device did accept, so the caller can resume
after them (see CaDescrambler::feed_ts,
which drains the device and retries the unsent tail).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl CiDataDevice for LinuxCiDataDevice
linux only.