Skip to main content

DeviceServerHandler

Trait DeviceServerHandler 

Source
pub trait DeviceServerHandler<___T: Transport = DriverChannel> {
    // Required methods
    fn get_max_transfer_size(
        &mut self,
        responder: Responder<GetMaxTransferSize, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn set_bitrate(
        &mut self,
        request: Request<SetBitrate, ___T>,
        responder: Responder<SetBitrate, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn transact(
        &mut self,
        request: Request<Transact, ___T>,
        responder: Responder<Transact, ___T>,
    ) -> impl Future<Output = ()> + Send;

    // Provided method
    fn on_unknown_interaction(
        &mut self,
        ordinal: u64,
    ) -> impl Future<Output = ()> + Send { ... }
}
Expand description

A server handler for the Device protocol.

See Device for more details.

Required Methods§

Source

fn get_max_transfer_size( &mut self, responder: Responder<GetMaxTransferSize, ___T>, ) -> impl Future<Output = ()> + Send

Source

fn set_bitrate( &mut self, request: Request<SetBitrate, ___T>, responder: Responder<SetBitrate, ___T>, ) -> impl Future<Output = ()> + Send

Sets the bitrate for the i2c bus in KHz units.

Source

fn transact( &mut self, request: Request<Transact, ___T>, responder: Responder<Transact, ___T>, ) -> impl Future<Output = ()> + Send

|Transact| assumes that write ops write_data length are not zero. |Transact| assumes that at least the last op has stop set to true.

For each read-transaction, there will be a corresponding ReadData returned. Write-transactions produce no data result.

Provided Methods§

Source

fn on_unknown_interaction( &mut self, ordinal: u64, ) -> impl Future<Output = ()> + Send

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§