Skip to main content

RaxKey

Trait RaxKey 

Source
pub trait RaxKey<RHS = Self>:
    Clone
    + Default
    + Debug {
    type Output: RaxKey;

    // Required methods
    fn encode(self) -> Self::Output;
    fn to_buf(&self) -> (*const u8, usize);
    unsafe fn from_buf(ptr: *const u8, len: usize) -> RHS;
}

Required Associated Types§

Required Methods§

Source

fn encode(self) -> Self::Output

Source

fn to_buf(&self) -> (*const u8, usize)

Source

unsafe fn from_buf(ptr: *const u8, len: usize) -> RHS

§Safety

ptr must be valid for reads of len bytes.

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 RaxKey for f32

Source§

type Output = u32

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> f32

Source§

impl RaxKey for f64

Source§

type Output = u64

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> f64

Source§

impl RaxKey for i16

Source§

type Output = i16

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> Self

Source§

impl RaxKey for i32

Source§

type Output = i32

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> i32

Source§

impl RaxKey for i64

Source§

type Output = i64

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> i64

Source§

impl RaxKey for i128

Source§

type Output = i128

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> i128

Source§

impl RaxKey for isize

Source§

type Output = isize

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> isize

Source§

impl RaxKey for u16

Source§

type Output = u16

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> u16

Source§

impl RaxKey for u32

Source§

type Output = u32

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> u32

Source§

impl RaxKey for u64

Source§

type Output = u64

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> u64

Source§

impl RaxKey for u128

Source§

type Output = u128

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> u128

Source§

impl RaxKey for usize

Source§

type Output = usize

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> usize

Source§

impl RaxKey for Vec<u8>

Source§

type Output = Vec<u8>

Source§

fn encode(self) -> Vec<u8>

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> Vec<u8>

Source§

impl<'a> RaxKey for &'a str

Source§

type Output = &'a str

Source§

fn encode(self) -> Self::Output

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> &'a str

Source§

impl<'a> RaxKey for &'a [u8]

Source§

type Output = &'a [u8]

Source§

fn encode(self) -> &'a [u8]

Source§

fn to_buf(&self) -> (*const u8, usize)

Source§

unsafe fn from_buf(ptr: *const u8, len: usize) -> &'a [u8]

Implementors§