Skip to main content

IntoDisk

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntoDisk for ()

Source§

type Bytes = [u8; 0]

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 BlockInfo

Source§

type Bytes = Vec<u8>

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 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 Node

Source§

type Bytes = Vec<u8>

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 NoteCommitmentSubtreeIndex

Source§

type Bytes = [u8; 2]

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 NoteCommitmentTree

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 Nullifier

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 Nullifier

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 OutputIndex

Source§

type Bytes = [u8; 3]

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 Root

Source§

type Bytes = [u8; 32]

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 Transaction

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<C: Constraint> IntoDisk for Amount<C>

Source§

type Bytes = [u8; 8]

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§