ctaphid_app

Trait App

Source
pub trait App<'interrupt, const N: usize> {
    // Required methods
    fn commands(&self) -> &'static [Command];
    fn call(
        &mut self,
        command: Command,
        request: &[u8],
        response: &mut Bytes<N>,
    ) -> Result<(), Error>;

    // Provided method
    fn interrupt(&self) -> Option<&'interrupt InterruptFlag> { ... }
}
Expand description

trait interface for a CTAPHID application. The application chooses which commands to register to, and will be called upon when the commands are received in the CTAPHID layer. Only one application can be registered to a particular command.

Required Methods§

Source

fn commands(&self) -> &'static [Command]

Define which CTAPHID commands to register to.

Source

fn call( &mut self, command: Command, request: &[u8], response: &mut Bytes<N>, ) -> Result<(), Error>

Application is called here when one of it’s register commands occurs. Application must put response in @message, or decide to return an error.

The response is pre-cleared.

Provided Methods§

Source

fn interrupt(&self) -> Option<&'interrupt InterruptFlag>

Get access to the app interrupter

Implementors§