Trait SecretField
pub trait SecretField {
// Required methods
fn mask(&mut self);
fn restore_from(&mut self, current: &Self);
fn encrypt_in_place(
&mut self,
store: &SecretStore,
field: &str,
) -> Result<()>;
fn decrypt_in_place(
&mut self,
store: &SecretStore,
field: &str,
) -> Result<()>;
fn is_set(&self) -> bool;
}Required Methods§
Sourcefn mask(&mut self)
fn mask(&mut self)
Replace each non-empty inner string with MASKED_SECRET.
Sourcefn restore_from(&mut self, current: &Self)
fn restore_from(&mut self, current: &Self)
Restore inner strings that currently equal MASKED_SECRET from the
matching position in current. The dashboard write path relies on this
so re-posting an already-displayed masked value doesn’t overwrite the
real secret in config.
Sourcefn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>
fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>
Encrypt every non-empty, not-already-encrypted inner string.
Sourcefn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>
fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>
Inverse of Self::encrypt_in_place.
Sourcefn is_set(&self) -> bool
fn is_set(&self) -> bool
Whether the field carries at least one non-empty inner string. Reported
back through SecretFieldInfo::is_set.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.