Skip to main content

ReplicaCtx

Struct ReplicaCtx 

Source
pub struct ReplicaCtx<'a> { /* private fields */ }
Expand description

A single CRC-valid metadata replica handed to MetadataCodec::unseal.

Exposes the parsed plaintext header, the raw 512-byte block (and the inner encrypted blob / salt / volume id within it), and sector-granular reads of THIS replica’s vendor-specific data region — everything a vendor needs to decide and run its metadata decryption.

Implementations§

Source§

impl<'a> ReplicaCtx<'a>

Source

pub fn header(&self) -> &JvckHeader

The parsed plaintext header (same for every replica of a volume).

Source

pub fn block(&self) -> &[u8]

The full 512-byte Metadata block (CRC already verified).

Source

pub fn encrypted_metadata(&self) -> &[u8]

The 128-byte EncryptedMetadata blob within the block.

Source

pub fn salt(&self) -> &[u8]

The per-write salt (plaintext) used to derive this replica’s keys.

Source

pub fn volume_id(&self) -> [u8; 16]

The volume id (plaintext) from the header bytes.

Source

pub fn replica_index(&self) -> usize

0-based index of this replica (header replicas first, then footer).

Source

pub fn vendor_data_sector_count(&self) -> u64

Sectors available in this replica’s vendor-specific data region.

Source

pub fn read_vendor_data(&self, rel_sector: u64, buf: &mut [u8]) -> VckResult<()>

Read buf (a whole number of sectors) from THIS replica’s vendor-specific data region, starting at vendor-relative rel_sector.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ReplicaCtx<'a>

§

impl<'a> !UnwindSafe for ReplicaCtx<'a>

§

impl<'a> Freeze for ReplicaCtx<'a>

§

impl<'a> Send for ReplicaCtx<'a>

§

impl<'a> Sync for ReplicaCtx<'a>

§

impl<'a> Unpin for ReplicaCtx<'a>

§

impl<'a> UnsafeUnpin for ReplicaCtx<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.