pub struct LockedConfig {
pub locks: HashMap<String, LockEntry>,
pub version: String,
}Expand description
Locked configuration storage
Fields§
§locks: HashMap<String, LockEntry>Map of configuration keys to their lock entries
version: StringVersion of the lock file format
Implementations§
Source§impl LockedConfig
impl LockedConfig
Sourcepub async fn load_from_level(level: ConfigLevel) -> Result<Option<Self>>
pub async fn load_from_level(level: ConfigLevel) -> Result<Option<Self>>
Load locked configuration from a specific level
§Errors
Returns an error if reading or parsing the lock file fails.
Sourcepub async fn save_to_level(&self, level: ConfigLevel) -> Result<()>
pub async fn save_to_level(&self, level: ConfigLevel) -> Result<()>
Save locked configuration to a specific level
§Errors
Returns an error if serialization fails or the file cannot be written.
Sourcepub fn lock_file_path_for_level(level: ConfigLevel) -> Result<PathBuf>
pub fn lock_file_path_for_level(level: ConfigLevel) -> Result<PathBuf>
Get the lock file path for a specific level
§Errors
Returns an error if the path cannot be determined.
Sourcepub fn list_locks(&self) -> Vec<(&String, &LockEntry)>
pub fn list_locks(&self) -> Vec<(&String, &LockEntry)>
List all locked keys
Trait Implementations§
Source§impl Clone for LockedConfig
impl Clone for LockedConfig
Source§fn clone(&self) -> LockedConfig
fn clone(&self) -> LockedConfig
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 LockedConfig
impl Debug for LockedConfig
Source§impl Default for LockedConfig
impl Default for LockedConfig
Source§fn default() -> LockedConfig
fn default() -> LockedConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LockedConfig
impl<'de> Deserialize<'de> for LockedConfig
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 LockedConfig
impl RefUnwindSafe for LockedConfig
impl Send for LockedConfig
impl Sync for LockedConfig
impl Unpin for LockedConfig
impl UnsafeUnpin for LockedConfig
impl UnwindSafe for LockedConfig
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,
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