Trait ledger_zondax_generic::AppExt
source · pub trait AppExt<E>: App{
// 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 { ... }
}
Expand description
Common commands for any given APP
This trait is automatically implemented for any type that implements App
Provided Methods§
sourcefn handle_response_error(
response: &APDUAnswer<E::AnswerType>
) -> Result<(), LedgerAppError<E::Error>>
fn handle_response_error( response: &APDUAnswer<E::AnswerType> ) -> Result<(), LedgerAppError<E::Error>>
sourcefn handle_response_error_signature(
response: &APDUAnswer<E::AnswerType>
) -> Result<(), LedgerAppError<E::Error>>
fn handle_response_error_signature( response: &APDUAnswer<E::AnswerType> ) -> Result<(), LedgerAppError<E::Error>>
sourcefn 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_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,
Retrieve the device info
Works only in the dashboard
sourcefn 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_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,
Retrieve the app info
Works only in app (TOOD: dashboard support)
sourcefn 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 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,
Retrieve the app version
sourcefn 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>>
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>>
Stream a long request in chunks, with an option to set P2 for all chunks. This method combines the functionality of sending chunks with or without P2 set for all chunks.
§Arguments
transport
- The transport layer used for communication.command
- The initial APDU command.message
- The message to be sent in chunks.set_p2_for_all
- A boolean to determine if P2 should be set for all chunks.
§Returns
A result containing the final APDU answer or a ledger application error.
Object Safety§
This trait is not object safe.