pub struct PluginConfig {
pub settings: HashMap<String, Value>,
pub enabled: bool,
pub auto_start: bool,
}Expand description
插件配置
Fields§
§settings: HashMap<String, Value>配置项
enabled: bool是否启用
auto_start: bool自动启动
Implementations§
Source§impl PluginConfig
impl PluginConfig
pub fn new() -> Self
pub fn get<T: DeserializeOwned>(&self, key: &str) -> Option<T>
pub fn set<T: Serialize>(&mut self, key: &str, value: T)
pub fn get_string(&self, key: &str) -> Option<String>
pub fn get_bool(&self, key: &str) -> Option<bool>
pub fn get_i64(&self, key: &str) -> Option<i64>
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§fn clone(&self) -> PluginConfig
fn clone(&self) -> PluginConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 PluginConfig
impl Debug for PluginConfig
Source§impl Default for PluginConfig
impl Default for PluginConfig
Source§fn default() -> PluginConfig
fn default() -> PluginConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PluginConfig
impl<'de> Deserialize<'de> for PluginConfig
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
Auto Trait Implementations§
impl Freeze for PluginConfig
impl RefUnwindSafe for PluginConfig
impl Send for PluginConfig
impl Sync for PluginConfig
impl Unpin for PluginConfig
impl UnsafeUnpin for PluginConfig
impl UnwindSafe for PluginConfig
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