Skip to main content

Modules

Struct Modules 

Source
pub struct Modules { /* private fields */ }
Expand description

The registered modules.

Implementations§

Source§

impl Modules

Source

pub fn new() -> Self

An empty registry.

Source

pub fn register(&mut self, module: Box<dyn Module>) -> Result<(), ModuleError>

Add a module under its own name; refuses a duplicate name or an unsupported interface version.

Source

pub fn get(&self, name: &str) -> Option<&dyn Module>

The module registered as name, if any.

Source

pub fn names(&self) -> impl Iterator<Item = &str>

The registered names, in order.

Trait Implementations§

Source§

impl Default for Modules

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Modules

§

impl !Send for Modules

§

impl !Sync for Modules

§

impl !UnwindSafe for Modules

§

impl Forget for Modules

§

impl Freeze for Modules
where *const LeafNode<String, Box<dyn Module>> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Box<dyn Module>)>>: Freeze,

§

impl Move for Modules

§

impl Unpin for Modules
where *const LeafNode<String, Box<dyn Module>> is !null: Unpin, Box<(String, Box<dyn Module>)>: Unpin,

§

impl UnsafeUnpin for Modules
where *const LeafNode<String, Box<dyn Module>> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, Box<dyn Module>)>>: UnsafeUnpin,

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.