pub struct VaultContainerV2 {
pub version: u16,
pub layers: Vec<Layer>,
pub keychain_wrapped: bool,
pub vault_id: Option<String>,
pub audit_log: Vec<AuditRecord>,
}Expand description
The v2 vault container.
Fields§
§version: u16§layers: Vec<Layer>§keychain_wrapped: bool§vault_id: Option<String>§audit_log: Vec<AuditRecord>Append-only audit DAG (ADR §10): the sealed records a decoy session writes but cannot
read. Only the real lane holds the audit secret that opens each record’s sealed blob. The
vault code only ever appends here; the per-branch head anchor (held inside the real lane’s
encrypted records) is what makes truncation / rewrite of the witnessed prefix detectable.
Implementations§
Source§impl VaultContainerV2
impl VaultContainerV2
Sourcepub fn new(
layers: Vec<Layer>,
keychain_wrapped: bool,
vault_id: Option<String>,
) -> Result<Self, String>
pub fn new( layers: Vec<Layer>, keychain_wrapped: bool, vault_id: Option<String>, ) -> Result<Self, String>
Build a container from the in-use layers, padded to constant shape. Errors if there are more
in-use layers than CONTAINER_SLOTS.
Sourcepub fn layer_by_role(&self, role: LayerRole) -> Option<&Layer>
pub fn layer_by_role(&self, role: LayerRole) -> Option<&Layer>
Find a layer by role (first match).
Sourcepub fn pad_to_constant_shape(&mut self)
pub fn pad_to_constant_shape(&mut self)
Pad with reserved layers up to CONTAINER_SLOTS so the layer count is constant.
Trait Implementations§
Source§impl Clone for VaultContainerV2
impl Clone for VaultContainerV2
Source§fn clone(&self) -> VaultContainerV2
fn clone(&self) -> VaultContainerV2
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 Debug for VaultContainerV2
impl Debug for VaultContainerV2
Source§impl<'de> Deserialize<'de> for VaultContainerV2
impl<'de> Deserialize<'de> for VaultContainerV2
Source§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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VaultContainerV2
impl PartialEq for VaultContainerV2
Source§fn eq(&self, other: &VaultContainerV2) -> bool
fn eq(&self, other: &VaultContainerV2) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for VaultContainerV2
impl Serialize for VaultContainerV2
impl Eq for VaultContainerV2
impl StructuralPartialEq for VaultContainerV2
Auto Trait Implementations§
impl Freeze for VaultContainerV2
impl RefUnwindSafe for VaultContainerV2
impl Send for VaultContainerV2
impl Sync for VaultContainerV2
impl Unpin for VaultContainerV2
impl UnsafeUnpin for VaultContainerV2
impl UnwindSafe for VaultContainerV2
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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>
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