usb_pd::sink

Trait Driver

source
pub trait Driver {
    type RxError;
    type TxError;

    // Required methods
    fn init(&mut self) -> impl Future<Output = ()>;
    fn receive_message(
        &mut self,
    ) -> impl Future<Output = Result<Option<Message>, Self::RxError>>;
    fn send_message(
        &mut self,
        header: Header,
        payload: &[u8],
    ) -> impl Future<Output = Result<(), Self::TxError>>;
    fn state(&mut self) -> DriverState;
}

Required Associated Types§

Required Methods§

source

fn init(&mut self) -> impl Future<Output = ()>

source

fn receive_message( &mut self, ) -> impl Future<Output = Result<Option<Message>, Self::RxError>>

source

fn send_message( &mut self, header: Header, payload: &[u8], ) -> impl Future<Output = Result<(), Self::TxError>>

source

fn state(&mut self) -> DriverState

Object Safety§

This trait is not object safe.

Implementors§