Struct CairoMemory

Source
pub struct CairoMemory<F> { /* private fields */ }
Expand description

This data structure stores the memory of the program

Implementations§

Source§

impl<F: Field> CairoMemory<F>

Source

pub fn new(input: Vec<F>) -> CairoMemory<F>

Create a new memory structure from a vector of field elements

Source

pub fn get_codelen(&self) -> usize

Get size of the public memory

Source

pub fn len(&self) -> u64

Get size of the full memory including dummy 0th entry

Source

pub fn is_empty(&self) -> bool

Returns whether the memory is empty (either length 0, or with the dummy first entry)

Source

pub fn write(&mut self, addr: F, elem: F)

Write u64 element in memory address

Source

pub fn read(&mut self, addr: F) -> Option<F>

Read element in memory address

Trait Implementations§

Source§

impl<F: Field> Display for CairoMemory<F>

Source§

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

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

impl<F: Field> Index<F> for CairoMemory<F>

Source§

type Output = Option<CairoWord<F>>

The returned type after indexing.
Source§

fn index(&self, idx: F) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<F: Field> IndexMut<F> for CairoMemory<F>

Source§

fn index_mut(&mut self, idx: F) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<F> Freeze for CairoMemory<F>

§

impl<F> RefUnwindSafe for CairoMemory<F>
where F: RefUnwindSafe,

§

impl<F> Send for CairoMemory<F>
where F: Send,

§

impl<F> Sync for CairoMemory<F>
where F: Sync,

§

impl<F> Unpin for CairoMemory<F>
where F: Unpin,

§

impl<F> UnwindSafe for CairoMemory<F>
where F: UnwindSafe,

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V