#[repr(C)]pub struct CosmicNQuin {
pub subject: u64,
pub predicate: u64,
pub object: u64,
pub context: u64,
pub metadata: u64,
pub parity: u64,
}Expand description
A 48-byte cosmic NQuin built from OCS components.
This is a repr(C) flat struct matching the NQuin ABI in
qualia-core-db. It can be transmuted to NQuin via bytemuck
when crossing the crate boundary.
Fields§
§subject: u64§predicate: u64§object: u64§context: u64§metadata: u64§parity: u64Implementations§
Source§impl CosmicNQuin
impl CosmicNQuin
Sourcepub fn cosmic_pose(
subject_did: &str,
pose_iri: &str,
realm_usri: &str,
level: HierarchyLevel,
sensitivity: u8,
lamport_clock: u32,
) -> Self
pub fn cosmic_pose( subject_did: &str, pose_iri: &str, realm_usri: &str, level: HierarchyLevel, sensitivity: u8, lamport_clock: u32, ) -> Self
Build a cosmic pose NQuin (OCS §14.2, OP_COSMIC_POSE).
Encodes: “entity subject_did has spacetime pose pose_iri
in realm realm_usri at level level”.
Sourcepub fn realm_transit(
subject_did: &str,
target_realm_usri: &str,
source_realm_usri: &str,
level: HierarchyLevel,
sensitivity: u8,
lamport_clock: u32,
) -> Self
pub fn realm_transit( subject_did: &str, target_realm_usri: &str, source_realm_usri: &str, level: HierarchyLevel, sensitivity: u8, lamport_clock: u32, ) -> Self
Build a realm transit NQuin (OCS §14.2, OP_REALM_TRANSIT).
Sourcepub fn observer_fiber(
observer_did: &str,
perceived_frame_usi: &str,
realm_usri: &str,
level: HierarchyLevel,
sensitivity: u8,
lamport_clock: u32,
) -> Self
pub fn observer_fiber( observer_did: &str, perceived_frame_usi: &str, realm_usri: &str, level: HierarchyLevel, sensitivity: u8, lamport_clock: u32, ) -> Self
Build an observer fiber NQuin (OCS §14.2, OP_OBSERVER_FIBER).
Sourcepub fn micro_pose(
subject_did: &str,
pose_iri: &str,
realm_usri: &str,
level: HierarchyLevel,
sensitivity: u8,
lamport_clock: u32,
) -> Self
pub fn micro_pose( subject_did: &str, pose_iri: &str, realm_usri: &str, level: HierarchyLevel, sensitivity: u8, lamport_clock: u32, ) -> Self
Build a micro-pose NQuin (OCS §14.2, OP_MICRO_POSE).
Sourcepub fn element_collapse(
narrative_entity_iri: &str,
physical_anchor_iri: &str,
realm_usri: &str,
level: HierarchyLevel,
sensitivity: u8,
lamport_clock: u32,
) -> Self
pub fn element_collapse( narrative_entity_iri: &str, physical_anchor_iri: &str, realm_usri: &str, level: HierarchyLevel, sensitivity: u8, lamport_clock: u32, ) -> Self
Build an element collapse NQuin (OCS §14.2, OP_ELEMENT_COLLAPSE).
Sourcepub fn subject_hash(&self) -> u64
pub fn subject_hash(&self) -> u64
Extract the subject DID hash (without MSB).
Sourcepub fn object_hash(&self) -> u64
pub fn object_hash(&self) -> u64
Extract the object IRI hash (without MSB).
Sourcepub fn sensitivity(&self) -> u8
pub fn sensitivity(&self) -> u8
Extract the sensitivity class from the context field.
Sourcepub fn realm_hash(&self) -> u64
pub fn realm_hash(&self) -> u64
Extract the realm hash from the context field (56-bit).
Sourcepub fn routing_lane(&self) -> u8
pub fn routing_lane(&self) -> u8
Extract the routing lane from the metadata field.
Sourcepub fn lamport_clock(&self) -> u32
pub fn lamport_clock(&self) -> u32
Extract the Lamport logical clock from the metadata field (29 bits).
Sourcepub fn realm_class_index(&self) -> u8
pub fn realm_class_index(&self) -> u8
Extract the realm class index from the metadata lower 32 bits.
Sourcepub fn hierarchy_level(&self) -> Option<HierarchyLevel>
pub fn hierarchy_level(&self) -> Option<HierarchyLevel>
Extract the hierarchy level from the metadata.
Sourcepub fn nesting_depth(&self) -> u8
pub fn nesting_depth(&self) -> u8
Extract the nesting depth from the metadata.
Sourcepub fn verify_parity(&self) -> bool
pub fn verify_parity(&self) -> bool
Verify the parity field (XOR fold check).
Sourcepub fn from_bytes(bytes: &[u8; 48]) -> Self
pub fn from_bytes(bytes: &[u8; 48]) -> Self
Decode from 48 bytes.
Sourcepub const fn size_bytes() -> usize
pub const fn size_bytes() -> usize
Size in bytes (always 48 for NQuin ABI).
Trait Implementations§
Source§impl Clone for CosmicNQuin
impl Clone for CosmicNQuin
impl Copy for CosmicNQuin
Source§impl Debug for CosmicNQuin
impl Debug for CosmicNQuin
impl Eq for CosmicNQuin
Source§impl Hash for CosmicNQuin
impl Hash for CosmicNQuin
Source§impl PartialEq for CosmicNQuin
impl PartialEq for CosmicNQuin
impl Pod for CosmicNQuin
impl StructuralPartialEq for CosmicNQuin
Auto Trait Implementations§
impl Freeze for CosmicNQuin
impl RefUnwindSafe for CosmicNQuin
impl Send for CosmicNQuin
impl Sync for CosmicNQuin
impl Unpin for CosmicNQuin
impl UnsafeUnpin for CosmicNQuin
impl UnwindSafe for CosmicNQuin
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.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
§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
key and return true if they are equal.