Trait API

Source
pub trait API {
    // Required methods
    fn get_origin_rak() -> Option<PublicKey>;
    fn get_origin_registration(app: AppId) -> Option<Registration>;
    fn is_authorized_origin(app: AppId) -> bool;
    fn get_registration(
        app: AppId,
        rak: PublicKey,
    ) -> Result<Registration, Error>;
    fn get_app(id: AppId) -> Result<AppConfig, Error>;
    fn get_apps() -> Result<Vec<AppConfig>, Error>;
    fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>;
}
Expand description

Interface that can be called from other modules.

Required Methods§

Source

fn get_origin_rak() -> Option<PublicKey>

Get the Runtime Attestation Key of the ROFL app instance in case the origin transaction is signed by a ROFL instance. Otherwise None is returned.

§Panics

This method will panic if called outside a transaction environment.

Source

fn get_origin_registration(app: AppId) -> Option<Registration>

Get the registration descriptor of the ROFL app instance in case the origin transaction is signed by a ROFL instance of the specified app. Otherwise None is returned.

§Panics

This method will panic if called outside a transaction environment.

Source

fn is_authorized_origin(app: AppId) -> bool

Verify whether the origin transaction is signed by an authorized ROFL instance for the given application.

§Panics

This method will panic if called outside a transaction environment.

Source

fn get_registration(app: AppId, rak: PublicKey) -> Result<Registration, Error>

Get a specific registered instance for an application.

Source

fn get_app(id: AppId) -> Result<AppConfig, Error>

Get an application’s configuration.

Source

fn get_apps() -> Result<Vec<AppConfig>, Error>

Get all application configurations.

Source

fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>

Get all registered instances for an application.

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§

Source§

impl<Cfg: Config> API for Module<Cfg>