Skip to main content

AgiContainerHeader

Struct AgiContainerHeader 

Source
#[repr(C)]
pub struct AgiContainerHeader { pub magic: u32, pub version: u16, pub flags: u16, pub container_id: [u8; 16], pub build_id: [u8; 16], pub created_ns: u64, pub model_id_hash: [u8; 8], pub policy_hash: [u8; 8], }
Expand description

Wire-format AGI container header (exactly 64 bytes, repr(C)).

Offset  Type        Field
0x00    u32         magic (0x52564147 "RVAG")
0x04    u16         version
0x06    u16         flags
0x08    [u8; 16]    container_id (UUID)
0x18    [u8; 16]    build_id (UUID)
0x28    u64         created_ns (UNIX epoch nanoseconds)
0x30    [u8; 8]     model_id_hash (SHA-256 truncated)
0x38    [u8; 8]     policy_hash (SHA-256 truncated)

Fields§

§magic: u32

Magic bytes: AGI_MAGIC.

§version: u16

Format version (currently 1).

§flags: u16

Bitfield flags indicating which segments are present.

§container_id: [u8; 16]

Unique container identifier (UUID).

§build_id: [u8; 16]

Build identifier (UUID, changes on each repackaging).

§created_ns: u64

Creation timestamp (nanoseconds since UNIX epoch).

§model_id_hash: [u8; 8]

SHA-256 of the pinned model identifier, truncated to 8 bytes.

§policy_hash: [u8; 8]

SHA-256 of the governance policy, truncated to 8 bytes.

Implementations§

Source§

impl AgiContainerHeader

Source

pub const fn is_valid_magic(&self) -> bool

Check magic bytes.

Source

pub const fn is_signed(&self) -> bool

Check if the container is signed.

Source

pub const fn has_kernel(&self) -> bool

Check if the container has a micro Linux kernel.

Source

pub const fn has_orchestrator(&self) -> bool

Check if the container has an orchestrator config.

Source

pub const fn is_replay_capable(&self) -> bool

Check if the container supports replay mode.

Source

pub const fn is_offline_capable(&self) -> bool

Check if the container can run offline.

Source

pub const fn has_world_model(&self) -> bool

Check if the container has a world model (VEC + INDEX segments).

Source

pub const fn has_coherence_gates(&self) -> bool

Check if the container has coherence gate configuration.

Source

pub const fn has_domain_expansion(&self) -> bool

Check if the container has domain expansion data.

Source

pub fn to_bytes(&self) -> [u8; 64]

Serialize header to a 64-byte array.

Source

pub fn from_bytes(data: &[u8]) -> Result<Self, RvfError>

Deserialize header from a byte slice (>= 64 bytes).

Trait Implementations§

Source§

impl Clone for AgiContainerHeader

Source§

fn clone(&self) -> AgiContainerHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgiContainerHeader

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AgiContainerHeader

Source§

fn eq(&self, other: &AgiContainerHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for AgiContainerHeader

Source§

impl Eq for AgiContainerHeader

Source§

impl StructuralPartialEq for AgiContainerHeader

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 = 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.