pub struct ModuleSettings(/* private fields */);Expand description
A struct containing settings for multiple signaling modules, each associated with the module’s namespace.
Implementations§
Source§impl ModuleSettings
impl ModuleSettings
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty ModuleSettings.
Sourcepub fn get<T: SignalingModuleSettings>(&self) -> Result<Option<T>, Error>
pub fn get<T: SignalingModuleSettings>(&self) -> Result<Option<T>, Error>
Get the settings for a specific module
Sourcepub fn insert<T: SignalingModuleSettings>(
&mut self,
data: &T,
) -> Result<(), Error>
pub fn insert<T: SignalingModuleSettings>( &mut self, data: &T, ) -> Result<(), Error>
Set the settings for a specific module
If an entry with the namespace already exists, it will be overwritten.
Sourcepub fn insert_empty(&mut self, namespace: ModuleId)
pub fn insert_empty(&mut self, namespace: ModuleId)
Insert an empty object for the specified module namespace
This is useful for adding modules that don’t require any settings.
Sourcepub fn remove(&mut self, namespace: &ModuleId) -> Option<Value>
pub fn remove(&mut self, namespace: &ModuleId) -> Option<Value>
Remove the settings for a specified module.
Trait Implementations§
Source§impl Clone for ModuleSettings
impl Clone for ModuleSettings
Source§fn clone(&self) -> ModuleSettings
fn clone(&self) -> ModuleSettings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModuleSettings
impl Debug for ModuleSettings
Source§impl Default for ModuleSettings
impl Default for ModuleSettings
Source§fn default() -> ModuleSettings
fn default() -> ModuleSettings
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModuleSettings
impl<'de> Deserialize<'de> for ModuleSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModuleSettings
Source§impl ExampleData for ModuleSettings
impl ExampleData for ModuleSettings
Source§fn example_data() -> Self
fn example_data() -> Self
Get an example instance of the current datatype.
Source§impl PartialEq for ModuleSettings
impl PartialEq for ModuleSettings
Source§impl Serialize for ModuleSettings
impl Serialize for ModuleSettings
impl StructuralPartialEq for ModuleSettings
Auto Trait Implementations§
impl Freeze for ModuleSettings
impl RefUnwindSafe for ModuleSettings
impl Send for ModuleSettings
impl Sync for ModuleSettings
impl Unpin for ModuleSettings
impl UnsafeUnpin for ModuleSettings
impl UnwindSafe for ModuleSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more