App

Struct App 

Source
pub struct App<T, R>
where T: TrussedClient, R: Reboot,
{ /* private fields */ }

Implementations§

Source§

impl<T, R> App<T, R>
where T: TrussedClient, R: Reboot,

Source

pub fn new(client: T, uuid: [u8; 16], version: u32) -> Self

Trait Implementations§

Source§

impl<T, R> App<{command::SIZE}, {response::SIZE}> for App<T, R>
where T: TrussedClient, R: Reboot,

Source§

fn select(&mut self, _apdu: &Command, _reply: &mut Data) -> Result

Given parsed APDU for select command. Write response data back to buf, and return length of payload. Return APDU Error code on error. Alternatively, the app can defer the response until later by returning it in poll().
Source§

fn deselect(&mut self)

Deselects the app. This is the result of another app getting selected. App should clear any sensitive state and reset security indicators.
Source§

fn call( &mut self, interface: Interface, apdu: &Command, reply: &mut Data, ) -> Result

Given parsed APDU for app when selected. Write response data back to buf, and return length of payload. Return APDU Error code on error.
Source§

impl<T, R> App for App<T, R>
where T: TrussedClient, R: Reboot,

Source§

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

Define which CTAPHID commands to register to.
Source§

fn call( &mut self, command: HidCommand, input_data: &Message, response: &mut Message, ) -> AppResult

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

impl<T, R> App for App<T, R>
where T: TrussedClient, R: Reboot,

Source§

fn aid(&self) -> Aid

Auto Trait Implementations§

§

impl<T, R> Freeze for App<T, R>
where T: Freeze,

§

impl<T, R> RefUnwindSafe for App<T, R>

§

impl<T, R> Send for App<T, R>
where T: Send, R: Send,

§

impl<T, R> Sync for App<T, R>
where T: Sync, R: Sync,

§

impl<T, R> Unpin for App<T, R>
where T: Unpin, R: Unpin,

§

impl<T, R> UnwindSafe for App<T, R>
where T: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.