risc0_zkp::layout

Trait Buffer

Source
pub trait Buffer: Sized {
    type Elem: Debug;
    type Reg: From<usize>;

    // Required methods
    fn tree<'a, C: Component>(&'a self, component: &'a C) -> Tree<'a, Self, C>;
    fn name(&self) -> &'static str;
    fn get(&self, reg: &Self::Reg) -> Option<&Self::Elem>;
    fn get_u64(&self, reg: &Self::Reg) -> u64;

    // Provided method
    fn get_u32(&self, reg: &Self::Reg) -> u32 { ... }
}
Expand description

A circuit execution trace buffer, which we can read laid out components from.

Required Associated Types§

Source

type Elem: Debug

The type of element stored in this buffer.

Source

type Reg: From<usize>

A register in this buffer, convertible from an offset.

Required Methods§

Source

fn tree<'a, C: Component>(&'a self, component: &'a C) -> Tree<'a, Self, C>

Returns the component tree rooted at the given component.

Source

fn name(&self) -> &'static str

Returns the argument name of this buffer.

Source

fn get(&self, reg: &Self::Reg) -> Option<&Self::Elem>

Retrieve an element from this buffer.

Source

fn get_u64(&self, reg: &Self::Reg) -> u64

Retrieve an element from this buffer and convert it to a u64

Provided Methods§

Source

fn get_u32(&self, reg: &Self::Reg) -> u32

Retrieve an element from this buffer and convert it to a u32

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§