[−][src]Struct mammoth_setup::config::module::Module
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]
P: AsRef<Path>,
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]
impl Validator<Module> for PathBuf
[src]
impl Clone for Module
[src]
fn clone(&self) -> 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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,