Skip to main content

App

Trait App 

Source
pub trait App<'interrupt> {
    // Required methods
    fn commands(&self) -> &'static [Command];
    fn call(
        &mut self,
        command: Command,
        request: &[u8],
        response: &mut BytesView,
    ) -> 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 BytesView, ) -> 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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§