Skip to main content

App

Struct App 

Source
pub struct App<T, S, C = ()> { /* private fields */ }

Implementations§

Source§

impl<T, S, C> App<T, S, C>
where T: TrussedClient, S: StatusBytes, C: Config,

Source

pub fn load_config<F: Filestore>( client: T, filestore: &mut F, data: Data, status: S, ) -> Result<Self, (T, ConfigError)>

Create an admin app instance, loading the configuration from the filesystem.

Source

pub fn migrate<F: Filestore>( &mut self, to_version: u32, store: impl Store, filestore: &mut F, ) -> Result<(), ConfigError>

Source

pub fn with_default_config(client: T, data: Data, status: S) -> Self

Create an admin app instance without the configuration mechanism, using the default config values.

This is only intended for debugging, testing and example code. In production, App::load_config should be used.

Source

pub fn config(&self) -> &C

Source

pub fn config_mut(&mut self) -> &mut C

Source

pub fn save_config_filestore<F: Filestore>( &mut self, filestore: &mut F, ) -> Result<(), ConfigError>

Source

pub fn status(&self) -> &S

Source

pub fn status_mut(&mut self) -> &mut S

Trait Implementations§

Source§

impl<T, S, C> App for App<T, S, C>

Source§

fn aid(&self) -> Aid

Source§

impl<T, S, C> App for App<T, S, C>
where T: TrussedClient, S: StatusBytes, C: Config,

Source§

fn select( &mut self, _interface: Interface, _apdu: CommandView<'_>, _reply: &mut VecView<u8>, ) -> 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: CommandView<'_>, reply: &mut VecView<u8>, ) -> 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, S, C> App<'static> for App<T, S, C>
where T: TrussedClient, S: StatusBytes, C: Config,

Source§

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

Define which CTAPHID commands to register to.
Source§

fn call( &mut self, command: HidCommand, input_data: &[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. Read more
Source§

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

Get access to the app interrupter

Auto Trait Implementations§

§

impl<T, S, C> Freeze for App<T, S, C>
where T: Freeze, S: Freeze, C: Freeze,

§

impl<T, S, C> RefUnwindSafe for App<T, S, C>

§

impl<T, S, C> Send for App<T, S, C>
where T: Send, S: Send, C: Send,

§

impl<T, S, C> Sync for App<T, S, C>
where T: Sync, S: Sync, C: Sync,

§

impl<T, S, C> Unpin for App<T, S, C>
where T: Unpin, S: Unpin, C: Unpin,

§

impl<T, S, C> UnsafeUnpin for App<T, S, C>

§

impl<T, S, C> UnwindSafe for App<T, S, C>
where T: UnwindSafe, S: UnwindSafe, C: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V