pub struct App<T, S, C = ()> { /* private fields */ }Implementations§
Source§impl<T, S, C> App<T, S, C>
impl<T, S, C> App<T, S, C>
Sourcepub fn load_config<F: Filestore>(
client: T,
filestore: &mut F,
data: Data,
status: S,
) -> Result<Self, (T, ConfigError)>
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.
pub fn migrate<F: Filestore>( &mut self, to_version: u32, store: impl Store, filestore: &mut F, ) -> Result<(), ConfigError>
Sourcepub fn with_default_config(client: T, data: Data, status: S) -> Self
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.
pub fn config(&self) -> &C
pub fn config_mut(&mut self) -> &mut C
pub fn save_config_filestore<F: Filestore>( &mut self, filestore: &mut F, ) -> Result<(), ConfigError>
pub fn status(&self) -> &S
pub fn status_mut(&mut self) -> &mut S
Trait Implementations§
Source§impl<T, S, C> App for App<T, S, C>where
T: TrussedClient,
S: StatusBytes,
impl<T, S, C> App for App<T, S, C>where
T: TrussedClient,
S: StatusBytes,
Source§impl<T, S, C> App for App<T, S, C>
impl<T, S, C> App for App<T, S, C>
Source§fn select(
&mut self,
_interface: Interface,
_apdu: CommandView<'_>,
_reply: &mut VecView<u8>,
) -> Result
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§impl<T, S, C> App<'static> for App<T, S, C>
impl<T, S, C> App<'static> for App<T, S, C>
Source§fn commands(&self) -> &'static [HidCommand]
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>
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>
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>
impl<T, S, C> RefUnwindSafe for App<T, S, C>
impl<T, S, C> Send for App<T, S, C>
impl<T, S, C> Sync for App<T, S, C>
impl<T, S, C> Unpin for App<T, S, C>
impl<T, S, C> UnsafeUnpin for App<T, S, C>
impl<T, S, C> UnwindSafe for App<T, S, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more