pub struct SaltConfig {
pub current: Option<String>,
pub previous: Option<String>,
}Expand description
Salt configuration for secret fingerprinting with rotation support
Fields§
§current: Option<String>Current salt (used for writing new fingerprints)
previous: Option<String>Previous salt (accepted for reading during rotation)
Implementations§
Source§impl SaltConfig
impl SaltConfig
Sourcepub const fn new(current: Option<String>) -> Self
pub const fn new(current: Option<String>) -> Self
Create a new salt config with only a current salt
Sourcepub const fn with_rotation(
current: Option<String>,
previous: Option<String>,
) -> Self
pub const fn with_rotation( current: Option<String>, previous: Option<String>, ) -> Self
Create a salt config with rotation support
Sourcepub fn write_salt(&self) -> Option<&str>
pub fn write_salt(&self) -> Option<&str>
Get the current salt for writing (returns current, or previous if current is None)
Trait Implementations§
Source§impl Clone for SaltConfig
impl Clone for SaltConfig
Source§fn clone(&self) -> SaltConfig
fn clone(&self) -> SaltConfig
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§impl Debug for SaltConfig
impl Debug for SaltConfig
Source§impl Default for SaltConfig
impl Default for SaltConfig
Source§fn default() -> SaltConfig
fn default() -> SaltConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SaltConfig
impl RefUnwindSafe for SaltConfig
impl Send for SaltConfig
impl Sync for SaltConfig
impl Unpin for SaltConfig
impl UnsafeUnpin for SaltConfig
impl UnwindSafe for SaltConfig
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