pub struct Settings {
pub confguard_base_dir: String,
pub guarded: String,
pub version: i64,
pub sops: Option<SopsConfig>,
}Fields§
§confguard_base_dir: String§guarded: String§version: i64§sops: Option<SopsConfig>Implementations§
Source§impl Settings
impl Settings
Sourcepub fn new() -> Result<Self, ConfigError>
pub fn new() -> Result<Self, ConfigError>
Creates a new Settings instance with values from config sources
Sourcepub fn global() -> &'static RwLock<Settings>
pub fn global() -> &'static RwLock<Settings>
Gets a reference to the global settings: Create it
Sourcepub fn read_global() -> RwLockReadGuard<'static, Settings>
pub fn read_global() -> RwLockReadGuard<'static, Settings>
Provides shared read access to the global settings
Sourcepub fn update_global(
new_settings: Settings,
) -> Result<(), PoisonError<RwLockWriteGuard<'static, Settings>>>
pub fn update_global( new_settings: Settings, ) -> Result<(), PoisonError<RwLockWriteGuard<'static, Settings>>>
Updates the global settings with exclusive write access
Sourcepub fn reload() -> Result<(), ConfigError>
pub fn reload() -> Result<(), ConfigError>
Force a reload of the settings from the environment
pub fn load_sops_config(&mut self, config_path: &Path) -> ConfGuardResult<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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 Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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