CloneableVec

Type Alias CloneableVec 

Source
pub type CloneableVec = Dynamic<CloneableVecInner>;

Aliased Type§

pub struct CloneableVec(/* private fields */);

Implementations§

Source§

impl CloneableVec

Source

pub const fn expose_inner(&self) -> &Vec<u8>

Source

pub fn expose_inner_mut(&mut self) -> &mut Vec<u8>

Source

pub fn init_with<F>(constructor: F) -> Self
where F: FnOnce() -> Vec<u8>,

Construct a cloneable vec secret by building it in a closure.

Same stack-minimization benefits as CloneableString::init_with.

§Example
use secure_gate::CloneableVec;

let seed = CloneableVec::init_with(|| {
    let mut v = vec![0u8; 32];
    // Fill from some source...
    v
});
Source

pub fn try_init_with<F, E>(constructor: F) -> Result<Self, E>
where F: FnOnce() -> Result<Vec<u8>, E>,

Fallible version of init_with.

Trait Implementations§

Source§

impl From<&[u8]> for CloneableVec

Available on crate feature zeroize only.
Source§

fn from(value: &[u8]) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for CloneableVec

Available on crate feature zeroize only.
Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.