pub struct SecretsHandle { /* private fields */ }Expand description
Shared handle to the secrets configuration consumed by the network stack.
Cloning is cheap; all clones observe the same swappable snapshot.
Implementations§
Source§impl SecretsHandle
impl SecretsHandle
Sourcepub fn new(config: SecretsConfig) -> Self
pub fn new(config: SecretsConfig) -> Self
Create a handle over the boot-time secrets configuration.
Sourcepub fn load(&self) -> Arc<SecretsConfig> ⓘ
pub fn load(&self) -> Arc<SecretsConfig> ⓘ
Load the current snapshot.
Sourcepub fn rotate_value(
&self,
name: &str,
value: String,
) -> Result<(), SecretsUpdateError>
pub fn rotate_value( &self, name: &str, value: String, ) -> Result<(), SecretsUpdateError>
Replace the value of an existing secret. The guest-visible placeholder and host allow-list are unchanged.
Sourcepub fn remove(&self, name: &str)
pub fn remove(&self, name: &str)
Stop resolving and injecting a secret for future connections. Removing an already-absent secret is a no-op: the goal state is reached.
Sourcepub fn set_allowed_hosts(
&self,
name: &str,
hosts: &[String],
) -> Result<(), SecretsUpdateError>
pub fn set_allowed_hosts( &self, name: &str, hosts: &[String], ) -> Result<(), SecretsUpdateError>
Replace the allowed hosts of an existing secret.
Trait Implementations§
Source§impl Clone for SecretsHandle
impl Clone for SecretsHandle
Source§fn clone(&self) -> SecretsHandle
fn clone(&self) -> SecretsHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SecretsHandle
impl RefUnwindSafe for SecretsHandle
impl Send for SecretsHandle
impl Sync for SecretsHandle
impl Unpin for SecretsHandle
impl UnsafeUnpin for SecretsHandle
impl UnwindSafe for SecretsHandle
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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