Trait zebra_state::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 Transaction

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for Address

§

type Bytes = [u8; 21]

source§

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

source§

impl IntoDisk for Option<SaplingScannedResult>

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for ()

§

type Bytes = [u8; 0]

source§

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

source§

impl IntoDisk for Amount<NonNegative>

§

type Bytes = [u8; 8]

source§

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

source§

impl IntoDisk for Hash

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for Header

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for Height

§

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

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for Node

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for NoteCommitmentTree

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for Root

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for Nullifier

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for Node

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for NoteCommitmentTree

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for Root

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for Nullifier

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for NoteCommitmentTree

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for Root

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for NoteCommitmentSubtreeIndex

§

type Bytes = [u8; 2]

source§

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

source§

impl IntoDisk for Hash

§

type Bytes = [u8; 32]

source§

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

source§

impl IntoDisk for Output

§

type Bytes = Vec<u8>

source§

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

source§

impl IntoDisk for ValueBalance<NonNegative>

§

type Bytes = [u8; 32]

source§

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

source§

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

§

type Bytes = <T as IntoDisk>::Bytes

source§

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

source§

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

§

type Bytes = Vec<u8>

source§

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

source§

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

§

type Bytes = <T as IntoDisk>::Bytes

source§

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

Implementors§