PluginRegistrar

Struct PluginRegistrar 

Source
pub struct PluginRegistrar<T>
where T: Plugin,
{ /* private fields */ }
Expand description

A registrar is created by a plugin manager and provided to the library’s registration function to register any plugins it has.

Implementations§

Source§

impl<T> PluginRegistrar<T>
where T: Plugin,

Source

pub fn register(&mut self, plugin: T)

Register a plugin, this will store the plugin in the registrar until the registration is completed. After the registration function completes, the plugin manager will add all plugins, if no errors were reported.

Source

pub fn error(&mut self, error: Box<dyn Error>)

Inform the registrar of an error, note that if multiple are recorded only the last will propagate out of the plugin manager.

Trait Implementations§

Source§

impl<T> Debug for PluginRegistrar<T>
where T: Plugin + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for PluginRegistrar<T>

§

impl<T> !RefUnwindSafe for PluginRegistrar<T>

§

impl<T> !Send for PluginRegistrar<T>

§

impl<T> !Sync for PluginRegistrar<T>

§

impl<T> Unpin for PluginRegistrar<T>

§

impl<T> !UnwindSafe for PluginRegistrar<T>

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.