pub struct SharedConfig {
pub version: String,
pub exported_from: ConfigLevel,
pub exported_by: String,
pub exported_at: String,
pub description: Option<String>,
pub config: PartialConfig,
pub locks: HashMap<String, LockExport>,
}Expand description
Shareable team configuration format
This structure represents a complete configuration snapshot that can be exported from one level and imported to another, preserving both configuration values and lock states.
Fields§
§version: StringVersion of the shared config format
exported_from: ConfigLevelConfiguration level this was exported from
exported_by: StringUsername who exported the config
exported_at: StringTimestamp of export (ISO 8601)
description: Option<String>Description of this config (optional)
config: PartialConfigThe configuration values
locks: HashMap<String, LockExport>Locked configuration keys
Implementations§
Sourcepub async fn from_level(level: ConfigLevel) -> Result<Self>
pub async fn from_level(level: ConfigLevel) -> Result<Self>
Create a new shared config from a specific level
§Errors
Returns an error if the hierarchical configuration cannot be loaded.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set a description for this shared config
Sourcepub async fn export_to_file(&self, path: &PathBuf) -> Result<()>
pub async fn export_to_file(&self, path: &PathBuf) -> Result<()>
Sourcepub async fn import_from_file(path: &PathBuf) -> Result<Self>
pub async fn import_from_file(path: &PathBuf) -> Result<Self>
Trait Implementations§
Source§fn clone(&self) -> SharedConfig
fn clone(&self) -> SharedConfig
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§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§
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