Skip to main content

Driver

Struct Driver 

Source
pub struct Driver<D: CaDevice> { /* private fields */ }
Expand description

Drives a CaDevice with the CiStack.

Implementations§

Source§

impl<D: CaDevice> Driver<D>

Source

pub fn new(device: D) -> Self

New driver over device, single transport connection.

Source

pub fn device(&self) -> &D

Borrow the underlying device (e.g. to inspect a mock’s recorded ops).

Source

pub fn next_timer(&self) -> Option<Duration>

The poll delay the stack most recently requested, if any.

Source

pub fn take_notifications(&mut self) -> Vec<Notification>

Drain the notifications collected so far.

Source

pub fn init(&mut self) -> Result<()>

Bring the interface up (reset + open the transport connection).

Source

pub fn send_ca_pmt(&mut self, ca_pmt: &[u8]) -> Result<()>

Request the module descramble the services in ca_pmt (a serialized ca_pmt APDU body, e.g. from dvb_ci::build_ca_pmt).

Source

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

One pump step: if the device is readable within timeout, read a frame and feed it; otherwise advance the stack’s timers by timeout (driving the poll cadence). Returns whether a frame was processed.

Auto Trait Implementations§

§

impl<D> !RefUnwindSafe for Driver<D>

§

impl<D> !Send for Driver<D>

§

impl<D> !Sync for Driver<D>

§

impl<D> !UnwindSafe for Driver<D>

§

impl<D> Freeze for Driver<D>
where D: Freeze,

§

impl<D> Unpin for Driver<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for Driver<D>
where D: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.