Struct dusk_api::FreightDeclaration[][src]

pub struct FreightDeclaration {
    pub rustc_version: &'static str,
    pub api_version: &'static str,
    pub freight_version: &'static str,
    pub name: &'static str,
    pub register: fn(_: &mut dyn FreightRegistrar),
}

A structure, exported by plugin, containing some package details and register function

This structure contains the rust compiler version, the plugin was compiled with, api version it uses, the plugin name and version and the actual function, that is used to register the plugin.

The function is only needed to pass a structure, that implements trait Freight to the FreightRegistrar::register_freight as structures can not be put into static variables, but static functions can.

This structure must only be built by export_freight! macro in plugins. And its fields are only read by FreightProxy::load function when loading the plugin

Fields

rustc_version: &'static str

Rust compiler version as a static string

api_version: &'static str

Api version as a static string

freight_version: &'static str

Version of the freight being imported

name: &'static str

Name of the freight being imported

register: fn(_: &mut dyn FreightRegistrar)

Function that gets a FreightRegistrar trait implementor as an argument and calls its freight_register function to provide unexportable things, such as structs, in particular, Freight implementor structures

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.