Api

Trait Api 

Source
pub trait Api: Send {
    type Install: Api;

    // Required method
    unsafe fn get() -> Result<&'static [u8], Error>;

    // Provided methods
    fn notify_start() { ... }
    fn notify_exit(status: ExitStatus) { ... }
}
Expand description

Applet interface.

Required Associated Types§

Source

type Install: Api

Installs or uninstalls an applet.

An empty transfer uninstalls the applet (because valid applets are not empty). A non-empty transfer installs the transferred applet.

Calling start(true) will uninstall the current applet if any. It is always possible to call start(), in which case a new transfer process is started.

Until finish() is called, there should be no installed applet. In particular, if the platform reboots and get() is called, the returned slice should be empty.

Required Methods§

Source

unsafe fn get() -> Result<&'static [u8], Error>

Returns the persisted applet.

§Safety

This function must not be called during a transfer process (unless it’s a dry-run). Besides, whenever start(true) is called, it invalidates the result of a previous call to this function.

Provided Methods§

Source

fn notify_start()

Notifies an applet start.

Source

fn notify_exit(status: ExitStatus)

Notifies an applet exit.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§