Skip to main content

SnapshotWidth

Trait SnapshotWidth 

Source
pub trait SnapshotWidth: SnapshotWidth + LayoutIndex {
    type LittleEndianWord: LayoutSnapshotWord<Index = Self>;

    // Required methods
    fn to_le_word(self) -> Self::LittleEndianWord;
    fn from_le_word(word: Self::LittleEndianWord) -> Self;
}
Expand description

A persisted unsigned width with its little-endian storage word.

This is the single width-to-LE-word bijection shared by oxgraph-csr, oxgraph-hyper-bcsr, and any future layout crate. usize deliberately does not implement it: persisted snapshots are fixed-width.

§Performance

SnapshotWidth::to_le_word and SnapshotWidth::from_le_word are O(1).

Required Associated Types§

Source

type LittleEndianWord: LayoutSnapshotWord<Index = Self>

Little-endian storage word for this width.

Required Methods§

Source

fn to_le_word(self) -> Self::LittleEndianWord

Lowers this logical index into its little-endian storage word.

§Performance

This function is O(1).

Source

fn from_le_word(word: Self::LittleEndianWord) -> Self

Recovers this logical index from a little-endian storage word.

§Performance

This function is O(1).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SnapshotWidth for u16

Source§

impl SnapshotWidth for u32

Source§

impl SnapshotWidth for u64

Implementors§