Struct AdviceMap
pub struct AdviceMap(/* private fields */);Expand description
Defines a set of non-deterministic (advice) inputs which the VM can access by their keys.
Each key maps to one or more field element. To access the elements, the VM can move the values
associated with a given key onto the advice stack using adv.push_mapval instruction. The VM
can also insert new values into the advice map during execution.
Implementations§
§impl AdviceMap
impl AdviceMap
pub fn contains_key(&self, key: &Word) -> bool
pub fn contains_key(&self, key: &Word) -> bool
Returns true if the key has a corresponding value in the map.
pub fn insert(
&mut self,
key: Word,
value: impl Into<Arc<[Felt]>>,
) -> Option<Arc<[Felt]>>
pub fn insert( &mut self, key: Word, value: impl Into<Arc<[Felt]>>, ) -> Option<Arc<[Felt]>>
Inserts a value, returning the previous value if the key was already set.
pub fn remove(&mut self, key: &Word) -> Option<Arc<[Felt]>>
pub fn remove(&mut self, key: &Word) -> Option<Arc<[Felt]>>
Removes the value associated with the key and returns the removed element.
pub fn iter(&self) -> impl Iterator<Item = (&Word, &Arc<[Felt]>)>
pub fn iter(&self) -> impl Iterator<Item = (&Word, &Arc<[Felt]>)>
Return an iteration over all entries in the map.
pub fn entry(&mut self, key: Word) -> Entry<'_, Word, Arc<[Felt]>>
pub fn entry(&mut self, key: Word) -> Entry<'_, Word, Arc<[Felt]>>
Gets the given key’s corresponding entry in the map for in-place manipulation.
pub fn merge(
&mut self,
other: &AdviceMap,
) -> Result<(), ((Word, Arc<[Felt]>), Arc<[Felt]>)>
pub fn merge( &mut self, other: &AdviceMap, ) -> Result<(), ((Word, Arc<[Felt]>), Arc<[Felt]>)>
Merges all entries from the given AdviceMap into the current advice map.
If an entry from the new map already exists with the same key but different value, an error is returned containing the existing entry along with the value that would replace it. The current map remains unchanged.
Trait Implementations§
§impl Arbitrary for AdviceMap
impl Arbitrary for AdviceMap
§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.§fn arbitrary_with(
_args: <AdviceMap as Arbitrary>::Parameters,
) -> <AdviceMap as Arbitrary>::Strategy
fn arbitrary_with( _args: <AdviceMap as Arbitrary>::Parameters, ) -> <AdviceMap as Arbitrary>::Strategy
§impl Deserializable for AdviceMap
impl Deserializable for AdviceMap
§fn read_from<R>(source: &mut R) -> Result<AdviceMap, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<AdviceMap, DeserializationError>where
R: ByteReader,
source, attempts to deserialize these bytes
into Self, and returns the result. Read more§fn min_serialized_size() -> usize
fn min_serialized_size() -> usize
§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
§fn read_from_bytes_with_budget(
bytes: &[u8],
budget: usize,
) -> Result<Self, DeserializationError>
fn read_from_bytes_with_budget( bytes: &[u8], budget: usize, ) -> Result<Self, DeserializationError>
Self from bytes with a byte budget limit. Read more§impl<'de> Deserialize<'de> for AdviceMap
impl<'de> Deserialize<'de> for AdviceMap
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AdviceMap, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AdviceMap, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<V> Extend<(Word, V)> for AdviceMap
impl<V> Extend<(Word, V)> for AdviceMap
§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (Word, V)>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (Word, V)>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl<V> FromIterator<(Word, V)> for AdviceMap
impl<V> FromIterator<(Word, V)> for AdviceMap
§impl IntoIterator for AdviceMap
impl IntoIterator for AdviceMap
§impl Serializable for AdviceMap
impl Serializable for AdviceMap
§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
self into bytes and writes these bytes into the target.§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
§impl Serialize for AdviceMap
impl Serialize for AdviceMap
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for AdviceMap
impl StructuralPartialEq for AdviceMap
Auto Trait Implementations§
impl Freeze for AdviceMap
impl RefUnwindSafe for AdviceMap
impl Send for AdviceMap
impl Sync for AdviceMap
impl Unpin for AdviceMap
impl UnsafeUnpin for AdviceMap
impl UnwindSafe for AdviceMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more