Api

Enum Api 

Source
#[non_exhaustive]
pub enum Api<'a, T: Direction> {
Show 13 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>), PlatformInfo(T::Type<'a, PlatformInfo>), PlatformVendor(T::Type<'a, PlatformVendor>), PlatformUpdateMetadata(T::Type<'a, PlatformUpdateMetadata>), PlatformUpdateTransfer(T::Type<'a, PlatformUpdateTransfer>), AppletInstall(T::Type<'a, AppletInstall>), AppletUninstall(T::Type<'a, AppletUninstall>), AppletExitStatus(T::Type<'a, AppletExitStatus>), PlatformLock(T::Type<'a, PlatformLock>),
}
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.

§

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

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

§

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

Calls a vendor-specific platform command.

§

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

Returns the metadata for platform update.

§

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

Updates the platform.

§

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

Installs an applet.

§

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

Uninstalls an applet.

§

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.

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, PlatformInfo>: Debug, T::Type<'a, PlatformVendor>: Debug, T::Type<'a, PlatformUpdateMetadata>: Debug, T::Type<'a, PlatformUpdateTransfer>: Debug, T::Type<'a, AppletInstall>: Debug, T::Type<'a, AppletUninstall>: Debug, T::Type<'a, AppletExitStatus>: Debug, T::Type<'a, PlatformLock>: 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, PlatformInfo>: Freeze, <T as Direction>::Type<'a, PlatformVendor>: Freeze, <T as Direction>::Type<'a, PlatformUpdateMetadata>: Freeze, <T as Direction>::Type<'a, PlatformUpdateTransfer>: Freeze, <T as Direction>::Type<'a, AppletInstall>: Freeze, <T as Direction>::Type<'a, AppletUninstall>: Freeze, <T as Direction>::Type<'a, AppletExitStatus>: Freeze, <T as Direction>::Type<'a, PlatformLock>: 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, PlatformInfo>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformVendor>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformUpdateMetadata>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformUpdateTransfer>: RefUnwindSafe, <T as Direction>::Type<'a, AppletInstall>: RefUnwindSafe, <T as Direction>::Type<'a, AppletUninstall>: RefUnwindSafe, <T as Direction>::Type<'a, AppletExitStatus>: RefUnwindSafe, <T as Direction>::Type<'a, PlatformLock>: 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, PlatformInfo>: Send, <T as Direction>::Type<'a, PlatformVendor>: Send, <T as Direction>::Type<'a, PlatformUpdateMetadata>: Send, <T as Direction>::Type<'a, PlatformUpdateTransfer>: Send, <T as Direction>::Type<'a, AppletInstall>: Send, <T as Direction>::Type<'a, AppletUninstall>: Send, <T as Direction>::Type<'a, AppletExitStatus>: Send, <T as Direction>::Type<'a, PlatformLock>: 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, PlatformInfo>: Sync, <T as Direction>::Type<'a, PlatformVendor>: Sync, <T as Direction>::Type<'a, PlatformUpdateMetadata>: Sync, <T as Direction>::Type<'a, PlatformUpdateTransfer>: Sync, <T as Direction>::Type<'a, AppletInstall>: Sync, <T as Direction>::Type<'a, AppletUninstall>: Sync, <T as Direction>::Type<'a, AppletExitStatus>: Sync, <T as Direction>::Type<'a, PlatformLock>: 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, PlatformInfo>: Unpin, <T as Direction>::Type<'a, PlatformVendor>: Unpin, <T as Direction>::Type<'a, PlatformUpdateMetadata>: Unpin, <T as Direction>::Type<'a, PlatformUpdateTransfer>: Unpin, <T as Direction>::Type<'a, AppletInstall>: Unpin, <T as Direction>::Type<'a, AppletUninstall>: Unpin, <T as Direction>::Type<'a, AppletExitStatus>: Unpin, <T as Direction>::Type<'a, PlatformLock>: 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, PlatformInfo>: UnwindSafe, <T as Direction>::Type<'a, PlatformVendor>: UnwindSafe, <T as Direction>::Type<'a, PlatformUpdateMetadata>: UnwindSafe, <T as Direction>::Type<'a, PlatformUpdateTransfer>: UnwindSafe, <T as Direction>::Type<'a, AppletInstall>: UnwindSafe, <T as Direction>::Type<'a, AppletUninstall>: UnwindSafe, <T as Direction>::Type<'a, AppletExitStatus>: UnwindSafe, <T as Direction>::Type<'a, PlatformLock>: 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>,