Trait Offset

Source
pub trait Offset: Copy {
    // Required methods
    fn between(from: usize, to: usize) -> Result<Self, OffsetError>;
    fn to_isize(&self) -> isize;
}
Expand description

A offset that can be used with RawRelPtr.

Required Methods§

Source

fn between(from: usize, to: usize) -> Result<Self, OffsetError>

Creates a new offset between a from position and a to position.

Source

fn to_isize(&self) -> isize

Gets the offset as an isize.

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.

Implementations on Foreign Types§

Source§

impl Offset for i8

Source§

fn between(from: usize, to: usize) -> Result<Self, OffsetError>

Source§

fn to_isize(&self) -> isize

Source§

impl Offset for u8

Source§

fn between(from: usize, to: usize) -> Result<Self, OffsetError>

Source§

fn to_isize(&self) -> isize

Implementors§