#[repr(C)]pub struct JournalHeader {
pub magic: [u8; 4],
pub version: u16,
pub profile: u16,
pub privacy: u8,
pub flags: u8,
pub reserved_head: [u8; 6],
pub world_did_hash: u64,
pub base_q42_digest: [u8; 32],
pub base_generation: u64,
pub schema_rule_version: u32,
pub required_pack_digest: [u8; 32],
pub reserved_tail: [u8; 28],
}Expand description
128-byte header stored at offset 0 of every .q42j file.
Fields§
§magic: [u8; 4]§version: u16§profile: u16§privacy: u8§flags: u8§reserved_head: [u8; 6]§world_did_hash: u64§base_q42_digest: [u8; 32]§base_generation: u64§schema_rule_version: u32§required_pack_digest: [u8; 32]§reserved_tail: [u8; 28]Implementations§
Source§impl JournalHeader
impl JournalHeader
Sourcepub fn new(
profile: JournalApplicationProfile,
world_did_hash: u64,
base_q42_digest: [u8; 32],
base_generation: u64,
) -> Self
pub fn new( profile: JournalApplicationProfile, world_did_hash: u64, base_q42_digest: [u8; 32], base_generation: u64, ) -> Self
Builds a 128-byte header for a new .q42j: current magic/version,
Sanctuary privacy, zeroed flags/reserved fields, schema_rule_version
1, and the caller’s world DID hash + base snapshot digest/generation.
Sourcepub fn to_bytes(&self) -> [u8; 128]
pub fn to_bytes(&self) -> [u8; 128]
Serializes the header to its fixed 128-byte little-endian layout.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, JournalError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, JournalError>
Parses a header; fails closed on short input, bad magic, or an unsupported format version.
Trait Implementations§
Source§impl Clone for JournalHeader
impl Clone for JournalHeader
Source§impl Debug for JournalHeader
impl Debug for JournalHeader
impl Eq for JournalHeader
Source§impl PartialEq for JournalHeader
impl PartialEq for JournalHeader
impl StructuralPartialEq for JournalHeader
Auto Trait Implementations§
impl Freeze for JournalHeader
impl RefUnwindSafe for JournalHeader
impl Send for JournalHeader
impl Sync for JournalHeader
impl Unpin for JournalHeader
impl UnsafeUnpin for JournalHeader
impl UnwindSafe for JournalHeader
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.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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