Skip to main content

AppExt

Trait AppExt 

Source
pub trait AppExt<E>: App
where E: Exchange + Send + Sync, E::Error: Error,
{ // Provided methods fn handle_response_error( response: &APDUAnswer<E::AnswerType>, ) -> Result<(), LedgerAppError<E::Error>> { ... } fn handle_response_error_signature( response: &APDUAnswer<E::AnswerType>, ) -> Result<(), LedgerAppError<E::Error>> { ... } fn get_device_info<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<DeviceInfo, LedgerAppError<E::Error>>> + Send + 'async_trait>> where 'life0: 'async_trait { ... } fn get_app_info<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<AppInfo, LedgerAppError<E::Error>>> + Send + 'async_trait>> where 'life0: 'async_trait { ... } fn get_version<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<Version, LedgerAppError<E::Error>>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn send_chunks<'life0, 'life1, 'async_trait, I>( transport: &'life0 E, command: APDUCommand<I>, message: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<APDUAnswer<E::AnswerType>, LedgerAppError<E::Error>>> + Send + 'async_trait>> where I: 'async_trait + Deref<Target = [u8]> + Send + Sync, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } }

Provided Methods§

Source

fn handle_response_error( response: &APDUAnswer<E::AnswerType>, ) -> Result<(), LedgerAppError<E::Error>>

Check APDU status word. Ok on 0x9000, otherwise map to SDK errors.

Source

fn handle_response_error_signature( response: &APDUAnswer<E::AnswerType>, ) -> Result<(), LedgerAppError<E::Error>>

Same as handle_response_error, but also requires non-empty payload (signature).

Source

fn get_device_info<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<DeviceInfo, LedgerAppError<E::Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait,

Query device info (target_id, SE/MCU versions, flags) via BOLOS CLA/INS.

Source

fn get_app_info<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<AppInfo, LedgerAppError<E::Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait,

Query current app info (name, version, flags) from the device.

Source

fn get_version<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<Version, LedgerAppError<E::Error>>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Query application version using the implementing app’s CLA.

Source

fn send_chunks<'life0, 'life1, 'async_trait, I>( transport: &'life0 E, command: APDUCommand<I>, message: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<APDUAnswer<E::AnswerType>, LedgerAppError<E::Error>>> + Send + 'async_trait>>
where I: 'async_trait + Deref<Target = [u8]> + Send + Sync, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a long message in chunks using Init/Add/Last framing on p1.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T, E> AppExt<E> for T
where T: App, E: Exchange + Send + Sync, E::Error: Error,