pub trait UsizeOpcode {
// Required methods
fn default_offset() -> usize;
fn from_usize(value: usize) -> Self;
fn as_usize(&self) -> usize;
// Provided method
fn with_default_offset(&self) -> usize { ... }
}
Required Methods§
fn default_offset() -> usize
Sourcefn from_usize(value: usize) -> Self
fn from_usize(value: usize) -> Self
Convert from the discriminant of the enum to the typed enum variant.
Default implementation uses from_repr
.
fn as_usize(&self) -> usize
Provided Methods§
fn with_default_offset(&self) -> usize
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.