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
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