pub struct FieldEncryptor { /* private fields */ }Expand description
Field-level encryptor for encrypting specific fields in structured data.
Implementations§
Source§impl FieldEncryptor
impl FieldEncryptor
Sourcepub fn new(encryptor: AtRestEncryptor) -> Self
pub fn new(encryptor: AtRestEncryptor) -> Self
Create a new field encryptor.
Sourcepub fn encrypt_string(&self, value: &str) -> Result<String>
pub fn encrypt_string(&self, value: &str) -> Result<String>
Encrypt a string field.
Sourcepub fn decrypt_string(&self, encrypted: &str) -> Result<String>
pub fn decrypt_string(&self, encrypted: &str) -> Result<String>
Decrypt a string field.
Sourcepub fn encrypt_json<T: Serialize>(&self, value: &T) -> Result<String>
pub fn encrypt_json<T: Serialize>(&self, value: &T) -> Result<String>
Encrypt a JSON-serializable value.
Sourcepub fn decrypt_json<T: DeserializeOwned>(&self, encrypted: &str) -> Result<T>
pub fn decrypt_json<T: DeserializeOwned>(&self, encrypted: &str) -> Result<T>
Decrypt a JSON-serializable value.
Auto Trait Implementations§
impl Freeze for FieldEncryptor
impl RefUnwindSafe for FieldEncryptor
impl Send for FieldEncryptor
impl Sync for FieldEncryptor
impl Unpin for FieldEncryptor
impl UnsafeUnpin for FieldEncryptor
impl UnwindSafe for FieldEncryptor
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