Skip to main content

Frame

Struct Frame 

Source
pub struct Frame<'a> { /* private fields */ }
Expand description

A completed frame produced by the guest: a sequence of opcodes plus arena access.

Frame is the transport seam: both the shared-memory ring (Host) and network batch decoders produce frame views, so consumers such as RenderTree::apply_frame work identically regardless of origin.

Implementations§

Source§

impl<'a> Frame<'a>

Source

pub fn from_parts( slots: &'a [u8], arena: &'a [u8], start: usize, end: usize, ) -> Self

Construct a frame view over contiguous 16-byte opcode slots plus an arena region (start/end are byte offsets into slots).

Used by transport backends to produce Frame views over their own buffers; Host builds these internally from the ring.

Source

pub fn opcodes(&self) -> FrameIter<'a> ⓘ

Iterate the opcodes in this frame, in order.

Source

pub fn len(&self) -> usize

Number of opcodes in the frame.

Source

pub fn is_empty(&self) -> bool

Source

pub fn arena_get(&self, offset: u32) -> Result<&'a [u8], ArenaError>

Read an arena entry by offset (see Guest::alloc / Guest::alloc_str).

Source

pub fn arena_str(&self, offset: u32) -> Result<&'a str, ArenaError>

Read an arena string by offset.

Source

pub fn arena(&self) -> &'a [u8] ⓘ

The full arena region (for transport serialization of arena deltas).

Auto Trait Implementations§

§

impl<'a> Forget for Frame<'a>

§

impl<'a> Freeze for Frame<'a>

§

impl<'a> RefUnwindSafe for Frame<'a>

§

impl<'a> Send for Frame<'a>

§

impl<'a> Sync for Frame<'a>

§

impl<'a> Unpin for Frame<'a>

§

impl<'a> UnsafeUnpin for Frame<'a>

§

impl<'a> UnwindSafe for Frame<'a>

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.