pub struct SecretGenerator { /* private fields */ }Expand description
Secret generator with state management
This is the main interface for generating secrets. It maintains state to ensure idempotent generation.
Implementations§
Source§impl SecretGenerator
impl SecretGenerator
Sourcepub fn with_state(state: SecretState) -> Self
pub fn with_state(state: SecretState) -> Self
Create from existing state (loaded from Kubernetes)
Sourcepub fn get_or_generate(&mut self, name: &str, length: usize) -> String
pub fn get_or_generate(&mut self, name: &str, length: usize) -> String
Get or generate a secret with default charset
Sourcepub fn get_or_generate_with_charset(
&mut self,
name: &str,
length: usize,
charset: SecretCharset,
) -> String
pub fn get_or_generate_with_charset( &mut self, name: &str, length: usize, charset: SecretCharset, ) -> String
Get or generate a secret with specific charset
Sourcepub fn state(&self) -> &SecretState
pub fn state(&self) -> &SecretState
Get the current state
Sourcepub fn into_state(self) -> SecretState
pub fn into_state(self) -> SecretState
Take ownership of the state (consumes the generator)
Trait Implementations§
Source§impl Debug for SecretGenerator
impl Debug for SecretGenerator
Auto Trait Implementations§
impl Freeze for SecretGenerator
impl RefUnwindSafe for SecretGenerator
impl Send for SecretGenerator
impl Sync for SecretGenerator
impl Unpin for SecretGenerator
impl UnwindSafe for SecretGenerator
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