Trait risc0_zkp::layout::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, convertable 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

Object Safety§

This trait is not object safe.

Implementors§