devela::_dep::rkyv::rel_ptr

Trait Offset

pub trait Offset: Copy + NoUndef {
    // Required methods
    fn from_isize<E>(value: isize) -> Result<Self, E> 
       where E: Source;
    fn to_isize(self) -> isize ;
}
Available on crate feature dep_rkyv only.
Expand description

A offset that can be used with RawRelPtr.

Required Methods§

fn from_isize<E>(value: isize) -> Result<Self, E>
where E: Source,

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

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§

§

impl Offset for i8

§

fn from_isize<E>(value: isize) -> Result<i8, E>
where E: Source,

§

fn to_isize(self) -> isize

§

impl Offset for u8

§

fn from_isize<E>(value: isize) -> Result<u8, E>
where E: Source,

§

fn to_isize(self) -> isize

Implementors§

§

impl Offset for i16_le

§

impl Offset for i32_le

§

impl Offset for i64_le

§

impl Offset for u16_le

§

impl Offset for u32_le

§

impl Offset for u64_le