pub struct ProfileRegistry { /* private fields */ }Expand description
A collection of named management profiles loaded from TOML.
Implementations§
Source§impl ProfileRegistry
impl ProfileRegistry
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, ProfileError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, ProfileError>
Load profiles from a TOML file.
Sourcepub fn from_toml(content: &str) -> Result<Self, ProfileError>
pub fn from_toml(content: &str) -> Result<Self, ProfileError>
Load profiles from a TOML string.
Sourcepub fn get(&self, name: &str) -> Option<&ManagementProfile>
pub fn get(&self, name: &str) -> Option<&ManagementProfile>
Get a profile by name.
Sourcepub fn validate_profile(p: &ManagementProfile) -> Result<(), ProfileError>
pub fn validate_profile(p: &ManagementProfile) -> Result<(), ProfileError>
Validate a single profile’s configuration (public static method).
Sourcepub fn insert(
&mut self,
profile: ManagementProfile,
overwrite: bool,
) -> Result<(), ProfileError>
pub fn insert( &mut self, profile: ManagementProfile, overwrite: bool, ) -> Result<(), ProfileError>
Insert a profile into the registry. If overwrite is false, returns
an error when a profile with the same name already exists.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProfileRegistry
impl RefUnwindSafe for ProfileRegistry
impl Send for ProfileRegistry
impl Sync for ProfileRegistry
impl Unpin for ProfileRegistry
impl UnsafeUnpin for ProfileRegistry
impl UnwindSafe for ProfileRegistry
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