zebra_state

Trait IntoDisk

source
pub trait IntoDisk {
    type Bytes: AsRef<[u8]>;

    // Required method
    fn as_bytes(&self) -> Self::Bytes;
}
Expand description

Helper type for writing types to disk as raw bytes. Also used to convert key types to raw bytes for disk lookups.

Required Associated Types§

source

type Bytes: AsRef<[u8]>

The type used to write bytes to disk, and compare a value as a key to on-disk keys.

Required Methods§

source

fn as_bytes(&self) -> Self::Bytes

Converts the current type into serialized raw bytes.

Used to convert keys to bytes in ReadDisk, and keys and values to bytes in WriteDisk.

§Panics
  • if the input data doesn’t serialize correctly

Implementations on Foreign Types§

source§

impl IntoDisk for Option<SaplingScannedResult>

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Transaction

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Address

source§

type Bytes = [u8; 21]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for ()

source§

type Bytes = [u8; 0]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Amount<NonNegative>

source§

type Bytes = [u8; 8]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Hash

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Header

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Height

source§

type Bytes = [u8; 3]

Consensus: see the note at MAX_ON_DISK_HEIGHT.

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Nullifier

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Node

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for NoteCommitmentTree

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Root

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Nullifier

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Node

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for NoteCommitmentTree

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Root

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Nullifier

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for NoteCommitmentTree

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Root

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for NoteCommitmentSubtreeIndex

source§

type Bytes = [u8; 2]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Hash

source§

type Bytes = [u8; 32]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for Output

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl IntoDisk for ValueBalance<NonNegative>

source§

type Bytes = [u8; 40]

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl<Root: IntoDisk<Bytes = Vec<u8>>> IntoDisk for NoteCommitmentSubtreeData<Root>

source§

type Bytes = Vec<u8>

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl<T> IntoDisk for &T
where T: IntoDisk,

source§

type Bytes = <T as IntoDisk>::Bytes

source§

fn as_bytes(&self) -> Self::Bytes

source§

impl<T> IntoDisk for Arc<T>
where T: IntoDisk,

source§

type Bytes = <T as IntoDisk>::Bytes

source§

fn as_bytes(&self) -> Self::Bytes

Implementors§