pub struct FieldEncryption { /* private fields */ }Expand description
Field-level encryption manager
Implementations§
Source§impl FieldEncryption
impl FieldEncryption
Sourcepub fn new(config: EncryptionConfig) -> Result<Self>
pub fn new(config: EncryptionConfig) -> Result<Self>
Create new field encryption manager
Sourcepub fn encrypt_string(
&self,
plaintext: &str,
field_name: &str,
) -> Result<EncryptedData>
pub fn encrypt_string( &self, plaintext: &str, field_name: &str, ) -> Result<EncryptedData>
Encrypt a string value
Sourcepub fn decrypt_string(&self, encrypted: &EncryptedData) -> Result<String>
pub fn decrypt_string(&self, encrypted: &EncryptedData) -> Result<String>
Decrypt a string value
Sourcepub fn rotate_keys(&self) -> Result<()>
pub fn rotate_keys(&self) -> Result<()>
Rotate encryption keys
Sourcepub fn get_stats(&self) -> EncryptionStats
pub fn get_stats(&self) -> EncryptionStats
Get encryption statistics
Auto Trait Implementations§
impl Freeze for FieldEncryption
impl !RefUnwindSafe for FieldEncryption
impl Send for FieldEncryption
impl Sync for FieldEncryption
impl Unpin for FieldEncryption
impl !UnwindSafe for FieldEncryption
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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