Skip to main content

DevicePrimaryTestOnly

Struct DevicePrimaryTestOnly 

Source
pub struct DevicePrimaryTestOnly {
    pub store: Arc<Store>,
    pub journal: DeviceJournalTestOnly,
    pub issuance: DeviceIssuanceTestOnly,
    /* private fields */
}
Expand description

The primary of the single-device offline profile (Go DevicePrimaryTestOnly). TEST ONLY.

Fields§

§store: Arc<Store>§journal: DeviceJournalTestOnly§issuance: DeviceIssuanceTestOnly

Implementations§

Source§

impl DevicePrimaryTestOnly

Source

pub fn new(store: Arc<Store>, replay_epoch: i64) -> V2Result<Self>

Go NewDevicePrimaryTestOnly: wrap store with an empty anchored journal store and an empty issuance store, serving replay_epoch.

Source

pub fn clone_primary(&self) -> Self

Go Clone: copy the complete primary state, modelling a backup or snapshot. The copy is not bound to any component.

Source

pub fn complete_state_digest_test_only(&self) -> V2Result<Vec<u8>>

Go CompleteStateDigestTestOnly.

Source

pub fn projection_test_only(&self) -> V2Result<DeviceStateProjectionTestOnly>

The §7.13 projection of the primary’s current records: the canonical bytes of every member, the projection object, and the complete-state digest.

Source

pub fn from_records_test_only(state_json: &[u8]) -> V2Result<Self>

A primary holding exactly the records of one state object of testvectors/v2/device-state.json (the §7.13 record encodings, with sealed bytes as terminal_b64, receipt_body_b64, body_b64, and snapshot_b64).

Trait Implementations§

Source§

impl Debug for DevicePrimaryTestOnly

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.