Api

Enum Api 

Source
#[non_exhaustive]
pub enum Api<'a, T: Direction> {
Show 18 variants ApiVersion(T::Type<'a, ApiVersion>), AppletRequest(T::Type<'a, AppletRequest>), AppletResponse(T::Type<'a, AppletResponse>), PlatformReboot(T::Type<'a, PlatformReboot>), AppletTunnel(T::Type<'a, AppletTunnel>), _PlatformInfo0(T::Type<'a, _PlatformInfo0>), PlatformVendor(T::Type<'a, PlatformVendor>), _PlatformUpdateMetadata(T::Type<'a, _PlatformUpdateMetadata>), _PlatformUpdate0(T::Type<'a, _PlatformUpdate0>), _AppletInstall0(T::Type<'a, _AppletInstall0>), _AppletUninstall0(T::Type<'a, _AppletUninstall0>), AppletExitStatus(T::Type<'a, AppletExitStatus>), PlatformLock(T::Type<'a, PlatformLock>), PlatformInfo(T::Type<'a, PlatformInfo>), PlatformClearStore(T::Type<'a, PlatformClearStore>), PlatformUpdate(T::Type<'a, PlatformUpdate>), AppletInstall(T::Type<'a, AppletInstall>), AppletReboot(T::Type<'a, AppletReboot>),
}
Expand description

Protocol API parametric over the message direction.

Deprecated variants are only available to the host (to support older devices).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ApiVersion(T::Type<'a, ApiVersion>)

Returns the device API version.

§

AppletRequest(T::Type<'a, AppletRequest>)

Sends a request to an applet.

§

AppletResponse(T::Type<'a, AppletResponse>)

Reads a response from an applet.

§

PlatformReboot(T::Type<'a, PlatformReboot>)

Reboots the platform.

§

AppletTunnel(T::Type<'a, AppletTunnel>)

Starts a direct tunnel with an applet.

§

_PlatformInfo0(T::Type<'a, _PlatformInfo0>)

Available on crate feature host only.

(deprecated) Returns platform information (e.g. serial and version).

This message is deprecated in favor of PlatformInfo.

§

PlatformVendor(T::Type<'a, PlatformVendor>)

Calls a vendor-specific platform command.

§

_PlatformUpdateMetadata(T::Type<'a, _PlatformUpdateMetadata>)

Available on crate feature host only.

(deprecated) Returns the metadata for platform update.

This message is deprecated in favor of PlatformVendor, which is the message for vendor-specific messages.

§

_PlatformUpdate0(T::Type<'a, _PlatformUpdate0>)

Available on crate feature host only.

(deprecated) Updates the platform.

This message is deprecated in favor of PlatformUpdate.

§

_AppletInstall0(T::Type<'a, _AppletInstall0>)

Available on crate feature host only.

(deprecated) Installs an applet.

This message is deprecated in favor of AppletInstall.

§

_AppletUninstall0(T::Type<'a, _AppletUninstall0>)

Available on crate feature host only.

(deprecated) Uninstalls an applet.

This message is deprecated in favor of AppletInstall with an empty transfer.

§

AppletExitStatus(T::Type<'a, AppletExitStatus>)

Returns the exit status of an applet, if not running.

§

PlatformLock(T::Type<'a, PlatformLock>)

Locks a platform until reboot.

This is useful for testing purposes by locking a platform before flashing a new one.

§

PlatformInfo(T::Type<'a, PlatformInfo>)

Returns platform information (serial, version, running side, opposite version, etc).

§

PlatformClearStore(T::Type<'a, PlatformClearStore>)

Clears the store for the platform and all applets.

The argument is the number of keys to protect. Using zero will clear all entries.

§

PlatformUpdate(T::Type<'a, PlatformUpdate>)

Updates the platform.

§

AppletInstall(T::Type<'a, AppletInstall>)

Installs or uninstalls an applet.

§

AppletReboot(T::Type<'a, AppletReboot>)

Reboots an applet.

Implementations§

Source§

impl Api<'_, Request>

Source

pub fn encode(&self) -> Result<Box<[u8]>, Error>

Available on crate feature host only.
Source§

impl<'a> Api<'a, Request>

Source

pub fn decode(data: &'a [u8]) -> Result<Self, Error>

Available on crate feature device only.

Trait Implementations§

Source§

impl<'a, T: Debug + Direction> Debug for Api<'a, T>
where T::Type<'a, ApiVersion>: Debug, T::Type<'a, AppletRequest>: Debug, T::Type<'a, AppletResponse>: Debug, T::Type<'a, PlatformReboot>: Debug, T::Type<'a, AppletTunnel>: Debug, T::Type<'a, _PlatformInfo0>: Debug, T::Type<'a, PlatformVendor>: Debug, T::Type<'a, _PlatformUpdateMetadata>: Debug, T::Type<'a, _PlatformUpdate0>: Debug, T::Type<'a, _AppletInstall0>: Debug, T::Type<'a, _AppletUninstall0>: Debug, T::Type<'a, AppletExitStatus>: Debug, T::Type<'a, PlatformLock>: Debug, T::Type<'a, PlatformInfo>: Debug, T::Type<'a, PlatformClearStore>: Debug, T::Type<'a, PlatformUpdate>: Debug, T::Type<'a, AppletInstall>: Debug, T::Type<'a, AppletReboot>: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: Direction> Wire<'a> for Api<'a, T>

Source§

type Type<'_a> = Api<'_a, T>

Source§

fn encode(&self, writer: &mut Writer<'a>) -> Result<()>

Source§

fn decode(reader: &mut Reader<'a>) -> Result<Self>

Auto Trait Implementations§

§

impl<'a, T> Freeze for Api<'a, T>
where <T as Direction>::Type<'a, ApiVersion>: Freeze, <T as Direction>::Type<'a, AppletRequest>: Freeze, <T as Direction>::Type<'a, AppletResponse>: Freeze, <T as Direction>::Type<'a, PlatformReboot>: Freeze, <T as Direction>::Type<'a, AppletTunnel>: Freeze, <T as Direction>::Type<'a, _PlatformInfo0>: Freeze, <T as Direction>::Type<'a, PlatformVendor>: Freeze, <T as Direction>::Type<'a, _PlatformUpdateMetadata>: Freeze, <T as Direction>::Type<'a, _PlatformUpdate0>: Freeze, <T as Direction>::Type<'a, _AppletInstall0>: Freeze, <T as Direction>::Type<'a, _AppletUninstall0>: Freeze, <T as Direction>::Type<'a, AppletExitStatus>: Freeze, <T as Direction>::Type<'a, PlatformLock>: Freeze, <T as Direction>::Type<'a, PlatformInfo>: Freeze, <T as Direction>::Type<'a, PlatformClearStore>: Freeze, <T as Direction>::Type<'a, PlatformUpdate>: Freeze, <T as Direction>::Type<'a, AppletInstall>: Freeze, <T as Direction>::Type<'a, AppletReboot>: Freeze,

§

impl<'a, T> RefUnwindSafe for Api<'a, T>
where <T as Direction>::Type<'a, ApiVersion>: RefUnwindSafe, <T as Direction>::Type<'a, AppletRequest>: RefUnwindSafe, <T as Direction>::Type<'a, AppletResponse>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformReboot>: RefUnwindSafe, <T as Direction>::Type<'a, AppletTunnel>: RefUnwindSafe, <T as Direction>::Type<'a, _PlatformInfo0>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformVendor>: RefUnwindSafe, <T as Direction>::Type<'a, _PlatformUpdateMetadata>: RefUnwindSafe, <T as Direction>::Type<'a, _PlatformUpdate0>: RefUnwindSafe, <T as Direction>::Type<'a, _AppletInstall0>: RefUnwindSafe, <T as Direction>::Type<'a, _AppletUninstall0>: RefUnwindSafe, <T as Direction>::Type<'a, AppletExitStatus>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformLock>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformInfo>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformClearStore>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformUpdate>: RefUnwindSafe, <T as Direction>::Type<'a, AppletInstall>: RefUnwindSafe, <T as Direction>::Type<'a, AppletReboot>: RefUnwindSafe,

§

impl<'a, T> Send for Api<'a, T>
where <T as Direction>::Type<'a, ApiVersion>: Send, <T as Direction>::Type<'a, AppletRequest>: Send, <T as Direction>::Type<'a, AppletResponse>: Send, <T as Direction>::Type<'a, PlatformReboot>: Send, <T as Direction>::Type<'a, AppletTunnel>: Send, <T as Direction>::Type<'a, _PlatformInfo0>: Send, <T as Direction>::Type<'a, PlatformVendor>: Send, <T as Direction>::Type<'a, _PlatformUpdateMetadata>: Send, <T as Direction>::Type<'a, _PlatformUpdate0>: Send, <T as Direction>::Type<'a, _AppletInstall0>: Send, <T as Direction>::Type<'a, _AppletUninstall0>: Send, <T as Direction>::Type<'a, AppletExitStatus>: Send, <T as Direction>::Type<'a, PlatformLock>: Send, <T as Direction>::Type<'a, PlatformInfo>: Send, <T as Direction>::Type<'a, PlatformClearStore>: Send, <T as Direction>::Type<'a, PlatformUpdate>: Send, <T as Direction>::Type<'a, AppletInstall>: Send, <T as Direction>::Type<'a, AppletReboot>: Send,

§

impl<'a, T> Sync for Api<'a, T>
where <T as Direction>::Type<'a, ApiVersion>: Sync, <T as Direction>::Type<'a, AppletRequest>: Sync, <T as Direction>::Type<'a, AppletResponse>: Sync, <T as Direction>::Type<'a, PlatformReboot>: Sync, <T as Direction>::Type<'a, AppletTunnel>: Sync, <T as Direction>::Type<'a, _PlatformInfo0>: Sync, <T as Direction>::Type<'a, PlatformVendor>: Sync, <T as Direction>::Type<'a, _PlatformUpdateMetadata>: Sync, <T as Direction>::Type<'a, _PlatformUpdate0>: Sync, <T as Direction>::Type<'a, _AppletInstall0>: Sync, <T as Direction>::Type<'a, _AppletUninstall0>: Sync, <T as Direction>::Type<'a, AppletExitStatus>: Sync, <T as Direction>::Type<'a, PlatformLock>: Sync, <T as Direction>::Type<'a, PlatformInfo>: Sync, <T as Direction>::Type<'a, PlatformClearStore>: Sync, <T as Direction>::Type<'a, PlatformUpdate>: Sync, <T as Direction>::Type<'a, AppletInstall>: Sync, <T as Direction>::Type<'a, AppletReboot>: Sync,

§

impl<'a, T> Unpin for Api<'a, T>
where <T as Direction>::Type<'a, ApiVersion>: Unpin, <T as Direction>::Type<'a, AppletRequest>: Unpin, <T as Direction>::Type<'a, AppletResponse>: Unpin, <T as Direction>::Type<'a, PlatformReboot>: Unpin, <T as Direction>::Type<'a, AppletTunnel>: Unpin, <T as Direction>::Type<'a, _PlatformInfo0>: Unpin, <T as Direction>::Type<'a, PlatformVendor>: Unpin, <T as Direction>::Type<'a, _PlatformUpdateMetadata>: Unpin, <T as Direction>::Type<'a, _PlatformUpdate0>: Unpin, <T as Direction>::Type<'a, _AppletInstall0>: Unpin, <T as Direction>::Type<'a, _AppletUninstall0>: Unpin, <T as Direction>::Type<'a, AppletExitStatus>: Unpin, <T as Direction>::Type<'a, PlatformLock>: Unpin, <T as Direction>::Type<'a, PlatformInfo>: Unpin, <T as Direction>::Type<'a, PlatformClearStore>: Unpin, <T as Direction>::Type<'a, PlatformUpdate>: Unpin, <T as Direction>::Type<'a, AppletInstall>: Unpin, <T as Direction>::Type<'a, AppletReboot>: Unpin,

§

impl<'a, T> UnwindSafe for Api<'a, T>
where <T as Direction>::Type<'a, ApiVersion>: UnwindSafe, <T as Direction>::Type<'a, AppletRequest>: UnwindSafe, <T as Direction>::Type<'a, AppletResponse>: UnwindSafe, <T as Direction>::Type<'a, PlatformReboot>: UnwindSafe, <T as Direction>::Type<'a, AppletTunnel>: UnwindSafe, <T as Direction>::Type<'a, _PlatformInfo0>: UnwindSafe, <T as Direction>::Type<'a, PlatformVendor>: UnwindSafe, <T as Direction>::Type<'a, _PlatformUpdateMetadata>: UnwindSafe, <T as Direction>::Type<'a, _PlatformUpdate0>: UnwindSafe, <T as Direction>::Type<'a, _AppletInstall0>: UnwindSafe, <T as Direction>::Type<'a, _AppletUninstall0>: UnwindSafe, <T as Direction>::Type<'a, AppletExitStatus>: UnwindSafe, <T as Direction>::Type<'a, PlatformLock>: UnwindSafe, <T as Direction>::Type<'a, PlatformInfo>: UnwindSafe, <T as Direction>::Type<'a, PlatformClearStore>: UnwindSafe, <T as Direction>::Type<'a, PlatformUpdate>: UnwindSafe, <T as Direction>::Type<'a, AppletInstall>: UnwindSafe, <T as Direction>::Type<'a, AppletReboot>: 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, 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.
Source§

impl<'a, T> Wire<'a> for T
where T: Wire<'a>,