pub struct Config {
pub default_instance: Option<OpenTalkInstanceId>,
pub instances: BTreeMap<OpenTalkInstanceId, OpenTalkInstanceConfig>,
}Expand description
Config to store needable state of the opentalk client
Fields§
§default_instance: Option<OpenTalkInstanceId>Default OpenTalk instance
instances: BTreeMap<OpenTalkInstanceId, OpenTalkInstanceConfig>OpenTalk instances
Implementations§
Source§impl Config
impl Config
Sourcepub fn get_default_instance(
&self,
) -> Option<(OpenTalkInstanceId, OpenTalkInstanceConfig)>
pub fn get_default_instance( &self, ) -> Option<(OpenTalkInstanceId, OpenTalkInstanceConfig)>
Get the default instance if available.
Sourcepub fn get_instance(
&self,
instance_id: &OpenTalkInstanceId,
) -> Option<OpenTalkInstanceConfig>
pub fn get_instance( &self, instance_id: &OpenTalkInstanceId, ) -> Option<OpenTalkInstanceConfig>
Get an instance by its OpenTalkInstanceId.
Sourcepub fn get_default_account(
&self,
) -> Option<(OpenTalkInstanceAccountId, OpenTalkAccountConfig)>
pub fn get_default_account( &self, ) -> Option<(OpenTalkInstanceAccountId, OpenTalkAccountConfig)>
Get the default account if available.
This will return the default account of the default instance.
Sourcepub fn get_instance_with_fallback_to_default(
&self,
instance_id: Option<&OpenTalkInstanceId>,
) -> Option<(OpenTalkInstanceId, OpenTalkInstanceConfig)>
pub fn get_instance_with_fallback_to_default( &self, instance_id: Option<&OpenTalkInstanceId>, ) -> Option<(OpenTalkInstanceId, OpenTalkInstanceConfig)>
Get an instance config by an optional id, returning the default config if the id is None.
Sourcepub fn get_account_with_fallback_to_default(
&self,
instance_id: Option<&OpenTalkInstanceId>,
account_id: Option<&OpenTalkAccountId>,
) -> Option<(OpenTalkInstanceAccountId, OpenTalkAccountConfig)>
pub fn get_account_with_fallback_to_default( &self, instance_id: Option<&OpenTalkInstanceId>, account_id: Option<&OpenTalkAccountId>, ) -> Option<(OpenTalkInstanceAccountId, OpenTalkAccountConfig)>
Get an account config by optional ids, returning the default config at each level if the ids are None.
Sourcepub fn remove_account(
&mut self,
instance_id: Option<&OpenTalkInstanceId>,
account_id: Option<&OpenTalkAccountId>,
)
pub fn remove_account( &mut self, instance_id: Option<&OpenTalkInstanceId>, account_id: Option<&OpenTalkAccountId>, )
Remove an account from the configuration.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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