pub struct EnvironmentManager { /* private fields */ }Expand description
Environment manager.
Tracks registered environments and the currently active one. Governance enforcement is done by the capability checker using the active environment’s governance scope.
Implementations§
Source§impl EnvironmentManager
impl EnvironmentManager
Sourcepub fn register(&self, env: Environment) -> Result<(), EnvironmentError>
pub fn register(&self, env: Environment) -> Result<(), EnvironmentError>
Register an environment.
Sourcepub fn set_active(&self, id: &str) -> Result<(), EnvironmentError>
pub fn set_active(&self, id: &str) -> Result<(), EnvironmentError>
Set the active environment.
Sourcepub fn active_id(&self) -> Option<EnvironmentId>
pub fn active_id(&self) -> Option<EnvironmentId>
Get the active environment ID.
Sourcepub fn active(&self) -> Option<Environment>
pub fn active(&self) -> Option<Environment>
Get the active environment.
Sourcepub fn get(&self, id: &str) -> Option<Environment>
pub fn get(&self, id: &str) -> Option<Environment>
Get an environment by ID.
Sourcepub fn list(&self) -> Vec<(EnvironmentId, EnvironmentClass, bool)>
pub fn list(&self) -> Vec<(EnvironmentId, EnvironmentClass, bool)>
List all environments.
Sourcepub fn remove(&self, id: &str) -> Result<Environment, EnvironmentError>
pub fn remove(&self, id: &str) -> Result<Environment, EnvironmentError>
Remove an environment.
Sourcepub fn create_standard_set(&self) -> Result<(), EnvironmentError>
pub fn create_standard_set(&self) -> Result<(), EnvironmentError>
Create a standard set of environments (dev, staging, prod).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EnvironmentManager
impl !RefUnwindSafe for EnvironmentManager
impl Send for EnvironmentManager
impl Sync for EnvironmentManager
impl Unpin for EnvironmentManager
impl UnsafeUnpin for EnvironmentManager
impl UnwindSafe for EnvironmentManager
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> 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