pub struct IdentityCodex;Expand description
Codex that leaves every byte unchanged.
IdentityCodex is the default Layer 5 implementation. It satisfies the
involution requirement trivially (x → x → x) and costs nothing at runtime.
Use a non-identity codex when you want the Layer 5 defense; use this one
when you are deliberately turning Layer 5 off.
§Examples
use key_vault::codex::{Codex, IdentityCodex};
let c = IdentityCodex;
assert_eq!(c.encode(0xab), 0xab);
assert_eq!(c.decode(0xab), 0xab);Trait Implementations§
Source§impl Clone for IdentityCodex
impl Clone for IdentityCodex
Source§fn clone(&self) -> IdentityCodex
fn clone(&self) -> IdentityCodex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Codex for IdentityCodex
impl Codex for IdentityCodex
Source§impl Debug for IdentityCodex
impl Debug for IdentityCodex
Source§impl Default for IdentityCodex
impl Default for IdentityCodex
Source§fn default() -> IdentityCodex
fn default() -> IdentityCodex
Returns the “default value” for a type. Read more
impl Copy for IdentityCodex
Auto Trait Implementations§
impl Freeze for IdentityCodex
impl RefUnwindSafe for IdentityCodex
impl Send for IdentityCodex
impl Sync for IdentityCodex
impl Unpin for IdentityCodex
impl UnsafeUnpin for IdentityCodex
impl UnwindSafe for IdentityCodex
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