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§
sourcefn apply_known_ap_change(self, ap_change: usize) -> Option<Self>
fn apply_known_ap_change(self, ap_change: usize) -> Option<Self>
Attempts to apply ap change, fail on overflow only.
sourcefn can_apply_unknown(&self) -> bool
fn can_apply_unknown(&self) -> bool
Can unknown ap change be applied.
Provided Methods§
sourcefn apply_ap_change(self, ap_change: ApChange) -> Result<Self, ApChangeError>
fn apply_ap_change(self, ap_change: ApChange) -> Result<Self, ApChangeError>
Attempts to apply ap change.
sourcefn unchecked_apply_known_ap_change(self, ap_change: usize) -> Self
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.