Trait rkyv::rel_ptr::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.

Object Safety§

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§