Struct EncryptedRecord
pub struct EncryptedRecord {
pub iv: Iv,
pub ciphertext: Vec<u8>,
pub tag: Vec<u8>,
pub descriptor: String,
pub dataset_id: Option<Uuid>,
}
Expand description
Represents an encrypted record for storage in the database. Implements serialization and deserialization so you can use it with any serde-compatible format however convenience methods are provided for CBOR, MessagePack, Hex, and Base85 encoding.
Fields§
§iv: Iv
§ciphertext: Vec<u8>
§tag: Vec<u8>
§descriptor: String
§dataset_id: Option<Uuid>
Implementations§
§impl EncryptedRecord
impl EncryptedRecord
pub fn to_vec(&self) -> Result<Vec<u8>, DecryptError>
👎Deprecated since 0.12.4: Use to_cbor_bytes or to_mp_bytes instead
pub fn to_vec(&self) -> Result<Vec<u8>, DecryptError>
Serialize the record to a Vec<u8>
using CBOR encoding
pub fn to_cbor_bytes(&self) -> Result<Vec<u8>, DecryptError>
pub fn to_cbor_bytes(&self) -> Result<Vec<u8>, DecryptError>
Serialize the record to a Vec<u8>
using CBOR encoding
pub fn to_mp_bytes(&self) -> Result<Vec<u8>, DecryptError>
pub fn to_mp_bytes(&self) -> Result<Vec<u8>, DecryptError>
Serialize the record to a Vec<u8>
using MessagePack encoding
pub fn to_hex(&self) -> Result<String, DecryptError>
👎Deprecated since 0.12.4: Use to_cbor_hex or to_mp_base85 instead
pub fn to_hex(&self) -> Result<String, DecryptError>
Serialize the record using CBOR and convert to a hex-encoded string
pub fn to_cbor_hex(&self) -> Result<String, DecryptError>
pub fn to_cbor_hex(&self) -> Result<String, DecryptError>
Serialize the record using CBOR and convert to a hex-encoded string
pub fn to_mp_base85(&self) -> Result<String, DecryptError>
pub fn to_mp_base85(&self) -> Result<String, DecryptError>
Serialize the record using MessagePack and convert to a base85-encoded string
pub fn from_slice(bytes: &[u8]) -> Result<Self, DecryptError>
👎Deprecated since 0.12.4: Use from_cbor_bytes or from_mp_bytes instead
pub fn from_slice(bytes: &[u8]) -> Result<Self, DecryptError>
Deserialize a record from a slice of bytes encoded using CBOR
pub fn from_cbor_bytes(bytes: &[u8]) -> Result<Self, DecryptError>
pub fn from_cbor_bytes(bytes: &[u8]) -> Result<Self, DecryptError>
Deserialize a record from a slice of bytes encoded using CBOR
pub fn from_mp_bytes(bytes: &[u8]) -> Result<Self, DecryptError>
pub fn from_mp_bytes(bytes: &[u8]) -> Result<Self, DecryptError>
Deserialize a record from a slice of bytes encoded using MessagePack
pub fn from_hex(hexstr: impl AsRef<[u8]>) -> Result<Self, DecryptError>
👎Deprecated since 0.12.4: Use from_cbor_hex or from_mp_base85 instead
pub fn from_hex(hexstr: impl AsRef<[u8]>) -> Result<Self, DecryptError>
Deserialize a record from a hex-encoded string of bytes encoded using CBOR
pub fn from_cbor_hex(hexstr: &str) -> Result<Self, DecryptError>
pub fn from_cbor_hex(hexstr: &str) -> Result<Self, DecryptError>
Deserialize a record from a hex-encoded string of bytes encoded using CBOR
pub fn from_mp_base85(base85str: &str) -> Result<Self, DecryptError>
pub fn from_mp_base85(base85str: &str) -> Result<Self, DecryptError>
Deserialize a record from a base85-encoded string of bytes encoded using MessagePack
Trait Implementations§
§impl Clone for EncryptedRecord
impl Clone for EncryptedRecord
§fn clone(&self) -> EncryptedRecord
fn clone(&self) -> EncryptedRecord
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for EncryptedRecord
impl Debug for EncryptedRecord
§impl<'de> Deserialize<'de> for EncryptedRecord
impl<'de> Deserialize<'de> for EncryptedRecord
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
§impl Serialize for EncryptedRecord
impl Serialize for EncryptedRecord
Auto Trait Implementations§
impl Freeze for EncryptedRecord
impl RefUnwindSafe for EncryptedRecord
impl Send for EncryptedRecord
impl Sync for EncryptedRecord
impl Unpin for EncryptedRecord
impl UnwindSafe for EncryptedRecord
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more