reth_db_api::table

Trait Compress

Source
pub trait Compress:
    Send
    + Sync
    + Sized
    + Debug {
    type Compressed: BufMut + AsRef<[u8]> + AsMut<[u8]> + Into<Vec<u8>> + Default + Send + Sync + Debug;

    // Required method
    fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B);

    // Provided methods
    fn uncompressable_ref(&self) -> Option<&[u8]> { ... }
    fn compress(self) -> Self::Compressed { ... }
}
Expand description

Trait that will transform the data to be saved in the DB in a (ideally) compressed format

Required Associated Types§

Source

type Compressed: BufMut + AsRef<[u8]> + AsMut<[u8]> + Into<Vec<u8>> + Default + Send + Sync + Debug

Compressed type.

Required Methods§

Source

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Compresses data to a given buffer.

Provided Methods§

Source

fn uncompressable_ref(&self) -> Option<&[u8]>

If the type cannot be compressed, return its inner reference as Some(self.as_ref())

Source

fn compress(self) -> Self::Compressed

Compresses data going into the database.

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 Compress for Account

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for Address

Source§

type Compressed = Vec<u8>

Source§

fn uncompressable_ref(&self) -> Option<&[u8]>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for B256

Source§

type Compressed = Vec<u8>

Source§

fn uncompressable_ref(&self) -> Option<&[u8]>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for BranchNodeCompact

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for Bytecode

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for Bytes

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for GenesisAccount

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for Header

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for IntegerList

Source§

type Compressed = Vec<u8>

Source§

fn compress(self) -> Self::Compressed

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for Log

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for PruneCheckpoint

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for Receipt

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for StageCheckpoint

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for StorageEntry

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for StorageTrieEntry

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for StoredNibbles

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for StoredNibblesSubKey

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for TransactionSigned

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for TransactionSignedNoHash

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Source§

impl Compress for TxType

Source§

type Compressed = Vec<u8>

Source§

fn compress_to_buf<B: BufMut + AsMut<[u8]>>(self, buf: &mut B)

Implementors§