Skip to main content

DeviceServerHandler

Trait DeviceServerHandler 

Source
pub trait DeviceServerHandler<___T: Transport = Channel> {
    // Required methods
    fn inject(
        &mut self,
        request: Request<Inject, ___T>,
        responder: Responder<Inject, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn inject_events(
        &mut self,
        request: Request<InjectEvents, ___T>,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

A server handler for the Device protocol.

See Device for more details.

Required Methods§

Source

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

Injects events into a target.

Batching: The caller is expected to batch-inject all events that share the same timestamp (e.g., multiple finger samples). There may be multiple such batches per injection call.

Flow control: The caller is allowed at most one in-flight |Inject| call at at time: subsequent |Inject| calls must wait until the acknowledgment returns. Non-compliance results in channel closure.

Source

fn inject_events( &mut self, request: Request<InjectEvents, ___T>, ) -> impl Future<Output = ()> + Send

Injects events into a target.

Batching: The caller is expected to batch-inject all events that share the same timestamp (e.g., multiple finger samples). There may be multiple such batches per injection call.

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§