[][src]Struct mammoth_setup::config::module::Module

pub struct Module { /* fields omitted */ }

Structure that defines configuration for a module library.

Methods

impl Module[src]

pub fn new(name: &str) -> Module[src]

Creates a new Module structure given its name.

pub fn new_disabled(name: &str) -> Module[src]

Creates a new, disabled Module structure given its name.

pub fn with_config(name: &str, enabled: bool, config: Value) -> Module[src]

Creates a new Module structure given its name and configuration.

pub fn name(&self) -> &str[src]

Obtains the name of the module.

pub fn enable(&mut self)[src]

Enables the module.

pub fn disable(&mut self)[src]

Disables the module.

pub fn enabled(&self) -> bool[src]

Returns true if the module is enabled and false otherwise.

pub fn config(&self) -> Option<&Value>[src]

Returns a reference to the TOML module configuration, if any.

pub fn config_mut(&mut self) -> Option<&mut Value>[src]

Returns a mutable reference to the TOML module configuration, if any.

pub fn into_config(self) -> Option<Value>[src]

Transforms the current Module structure into its TOML configuration, if any.

pub fn location(&self) -> Option<&Path>[src]

Returns the path of the library containing this module, if any.

If no location is given, this function returns None and Mammoth uses the default module directory.

pub fn set_location<P>(&mut self, path: P) where
    P: AsRef<Path>, 
[src]

Sets the path of the library containing this module.

pub fn clear_location(&mut self)[src]

Removes the given path of the library containing this module.

pub fn load_into(&self, mod_set: &mut LoadedModuleSet) -> Result<(), Error>[src]

Tries to load the library.

Trait Implementations

impl Id for Module[src]

type Identifier = String

fn description(&self) -> &str[src]

impl Validator<Module> for PathBuf[src]

impl Clone for Module[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Module[src]

impl<'de> Deserialize<'de> for Module[src]

Auto Trait Implementations

impl Sync for Module

impl Send for Module

impl Unpin for Module

impl RefUnwindSafe for Module

impl UnwindSafe for Module

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]