Skip to main content

Frame0File

Struct Frame0File 

Source
pub struct Frame0File;
Expand description

Frame-0 NV02 keyframe file (frame0.nv02) + 40-byte little-endian footer.

Implementations§

Source§

impl Frame0File

Source

pub fn encode( store: &NodeStore, meta: Frame0Meta, ) -> Result<Vec<u8>, PersistenceError>

Source

pub fn encode_nv02( nv02_payload: &[u8], node_count: u32, meta: Frame0Meta, ) -> Result<Vec<u8>, PersistenceError>

Source

pub fn save( path: impl AsRef<Path>, store: &NodeStore, meta: Frame0Meta, ) -> Result<Frame0Footer, PersistenceError>

Source

pub fn save_bytes( path: impl AsRef<Path>, envelope_bytes: &[u8], ) -> Result<(), PersistenceError>

Source

pub fn validate_bytes( bytes: &[u8], expected: Frame0Meta, ) -> Result<(Frame0Footer, &[u8]), Frame0Miss>

Source

pub fn read_and_validate_bytes( bytes: &[u8], expected_schema_hash: u64, expected_app_build_id: u64, expected_env_hash: u64, ) -> Result<(Frame0Footer, &[u8]), Frame0Miss>

Validates an in-memory frame0.nv02 envelope buffer against the expected schema hash, app build ID, and environment hash, returning the parsed footer and borrowed NV02 keyframe payload slice without copying.

Source

pub fn read_and_validate( path: impl AsRef<Path>, expected: Frame0Meta, ) -> Result<(Frame0Footer, Vec<u8>), Frame0Miss>

Source

pub fn boot_bytes_into_replica<B: StoreBackend>( bytes: &[u8], expected: Frame0Meta, replica: &mut StoreWireReplica<B>, ) -> Result<(Frame0Footer, BackendApplyStats), Frame0Miss>

Source

pub fn boot_into_replica<B: StoreBackend>( path: impl AsRef<Path>, expected: Frame0Meta, replica: &mut StoreWireReplica<B>, ) -> Result<(Frame0Footer, BackendApplyStats), Frame0Miss>

Source

pub fn boot_into_replica_with_buf<B: StoreBackend>( path: impl AsRef<Path>, expected: Frame0Meta, scratch: &mut Vec<u8>, replica: &mut StoreWireReplica<B>, ) -> Result<(Frame0Footer, BackendApplyStats), Frame0Miss>

Source

pub fn file_has_nv02_magic(path: &Path) -> bool

Returns true iff path exists, is readable, and begins with the 4-byte NV02 magic header (prevents corrupt-file cleanup from deleting unrelated files).

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, 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.