Skip to main content

Module

Struct Module 

Source
pub struct Module { /* private fields */ }

Implementations§

Source§

impl Module

Source

pub fn id(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn library_sha256(&self) -> &str

Source

pub fn name(&self) -> &str

The factory’s display name.

Source

pub fn injects(&self) -> Vec<TypeKey>

Source

pub fn schema(&self) -> Option<&Value>

The config’s JSON Schema, when the plugin exported one.

Source

pub fn factory(&self) -> &dyn PluginFactory<ConfigValue>

The plugin’s factory over JSON config. Build plugins with Module::build: a plugin built here directly is not marked as this library’s code, and what it provides of a #[rutis::service] type of the library is not served by name (only the program’s own marked types are, for code of no library).

Source

pub fn generation(&self) -> Generation

The generation the library was loaded as (rutis::service::loading).

Source

pub fn build(&self, config: &ConfigValue) -> Result<Box<dyn DynPlugin>, Error>

Build the plugin for config, its fiber marked as this library’s code (rutis::service::set_generation): a #[rutis::service] value it provides is served with this library’s blocks, even when another build of the same plugin, with the same TypeIds, is loaded too.

Trait Implementations§

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.