redb

Trait MutInPlaceValue

Source
pub trait MutInPlaceValue: Value {
    type BaseRefType: Debug + ?Sized;

    // Required methods
    fn initialize(data: &mut [u8]);
    fn from_bytes_mut(data: &mut [u8]) -> &mut Self::BaseRefType;
}
Expand description

Implementing this trait indicates that the type can be mutated in-place as a &mut u8. This enables the .insert_reserve() method on Table

Required Associated Types§

Source

type BaseRefType: Debug + ?Sized

The base type such that &mut u8 can be safely transmuted to &mut BaseRefType

Required Methods§

Source

fn initialize(data: &mut [u8])

Source

fn from_bytes_mut(data: &mut [u8]) -> &mut Self::BaseRefType

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 MutInPlaceValue for &[u8]

Source§

type BaseRefType = [u8]

Source§

fn initialize(_data: &mut [u8])

Source§

fn from_bytes_mut(data: &mut [u8]) -> &mut Self::BaseRefType

Implementors§