cairo_lang_casm::ap_change

Trait ApplyApChange

Source
pub trait ApplyApChange: Sized {
    // Required methods
    fn apply_known_ap_change(self, ap_change: usize) -> Option<Self>;
    fn can_apply_unknown(&self) -> bool;

    // Provided methods
    fn apply_ap_change(self, ap_change: ApChange) -> Result<Self, ApChangeError> { ... }
    fn unchecked_apply_known_ap_change(self, ap_change: usize) -> Self { ... }
}
Expand description

Trait for applying ap changes.

Required Methods§

Source

fn apply_known_ap_change(self, ap_change: usize) -> Option<Self>

Attempts to apply ap change, fail on overflow only.

Source

fn can_apply_unknown(&self) -> bool

Can unknown ap change be applied.

Provided Methods§

Source

fn apply_ap_change(self, ap_change: ApChange) -> Result<Self, ApChangeError>

Attempts to apply ap change.

Source

fn unchecked_apply_known_ap_change(self, ap_change: usize) -> Self

Same as Self::apply_known_ap_change but unchecked.

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§