pub struct StoredConfigs {
pub default: Option<String>,
pub servers: HashMap<String, StoredServer>,
pub cipher: PassEncryptor,
pub config_file: PathBuf,
}
Fields§
§default: Option<String>
§servers: HashMap<String, StoredServer>
§cipher: PassEncryptor
§config_file: PathBuf
Implementations§
Source§impl StoredConfigs
impl StoredConfigs
pub fn new(pass_key: Option<String>, config_file: PathBuf) -> Self
pub fn default_server(&self) -> Option<&StoredServer>
pub fn getorinit_config_file() -> Result<PathBuf, StoredConfigError>
pub async fn save_to_file(&self) -> Result<&Self, StoredConfigError>
pub async fn read_from_file(&mut self) -> Result<&mut Self, StoredConfigError>
pub fn get_server_as_oidc_server( &self, name: &str, ) -> Result<&OidcServer, StoredConfigError>
pub fn get_server_as_password_server( &self, name: &str, ) -> Result<&PasswordServer, StoredConfigError>
pub async fn upsert_server( &mut self, server: StoredServer, ) -> Result<&mut Self, StoredConfigError>
pub async fn remove_server( &mut self, name: &str, ) -> Result<&mut Self, StoredConfigError>
pub async fn set_default_server( &mut self, name: &str, ) -> Result<&mut Self, StoredConfigError>
Trait Implementations§
Source§impl Clone for StoredConfigs
impl Clone for StoredConfigs
Source§fn clone(&self) -> StoredConfigs
fn clone(&self) -> StoredConfigs
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 StoredConfigs
impl Debug for StoredConfigs
Source§impl From<StoredConfigs> for StoredConfigsJson
impl From<StoredConfigs> for StoredConfigsJson
Source§fn from(config: StoredConfigs) -> StoredConfigsJson
fn from(config: StoredConfigs) -> StoredConfigsJson
Converts to this type from the input type.
Source§impl TryFrom<(StoredConfigsJson, PathBuf)> for StoredConfigs
impl TryFrom<(StoredConfigsJson, PathBuf)> for StoredConfigs
Source§type Error = StoredConfigError
type Error = StoredConfigError
The type returned in the event of a conversion error.
Source§fn try_from(
(json, config_file): (StoredConfigsJson, PathBuf),
) -> Result<StoredConfigs, StoredConfigError>
fn try_from( (json, config_file): (StoredConfigsJson, PathBuf), ) -> Result<StoredConfigs, StoredConfigError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for StoredConfigs
impl RefUnwindSafe for StoredConfigs
impl Send for StoredConfigs
impl Sync for StoredConfigs
impl Unpin for StoredConfigs
impl UnwindSafe for StoredConfigs
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