[][src]Struct solana::blocktree::Blocktree

pub struct Blocktree {
    pub new_blobs_signals: Vec<SyncSender<bool>>,
    pub completed_slots_senders: Vec<SyncSender<Vec<u64>>>,
    // some fields omitted
}

Fields

new_blobs_signals: Vec<SyncSender<bool>>completed_slots_senders: Vec<SyncSender<Vec<u64>>>

Methods

impl Blocktree[src]

pub fn open(ledger_path: &str) -> Result<Blocktree>[src]

Opens a Ledger in directory, provides "infinite" window of blobs

pub fn open_with_signal(
    ledger_path: &str
) -> Result<(Self, Receiver<bool>, CompletedSlotsReceiver)>
[src]

pub fn destroy(ledger_path: &str) -> Result<()>[src]

pub fn meta(&self, slot: u64) -> Result<Option<SlotMeta>>[src]

pub fn is_full(&self, slot: u64) -> bool[src]

pub fn purge_slots(&self, from_slot: Slot, to_slot: Option<Slot>)[src]

Silently deletes all blocktree column families starting at the given slot until the to slot Dangerous; Use with care: Does not check for integrity and does not update slot metas that refer to deleted slots Modifies multiple column families simultaneously

pub fn erasure_meta(
    &self,
    slot: u64,
    set_index: u64
) -> Result<Option<ErasureMeta>>
[src]

pub fn orphan(&self, slot: u64) -> Result<Option<bool>>[src]

pub fn rooted_slot_iterator(&self, slot: u64) -> Result<RootedSlotIterator>[src]

pub fn slot_meta_iterator(
    &self,
    slot: u64
) -> Result<impl Iterator<Item = (u64, SlotMeta)>>
[src]

pub fn slot_data_iterator(
    &self,
    slot: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)>>
[src]

pub fn write_shared_blobs<I>(&self, shared_blobs: I) -> Result<()> where
    I: IntoIterator,
    I::Item: Borrow<SharedBlob>, 
[src]

Use this function to write data blobs to blocktree

pub fn write_blobs<I>(&self, blobs: I) -> Result<()> where
    I: IntoIterator,
    I::Item: Borrow<Blob>, 
[src]

pub fn write_entries<I>(
    &self,
    start_slot: u64,
    num_ticks_in_start_slot: u64,
    start_index: u64,
    ticks_per_slot: u64,
    entries: I
) -> Result<()> where
    I: IntoIterator,
    I::Item: Borrow<Entry>, 
[src]

pub fn insert_data_blobs<I>(&self, new_blobs: I) -> Result<()> where
    I: IntoIterator,
    I::Item: Borrow<Blob>, 
[src]

pub fn read_blobs_bytes(
    &self,
    start_index: u64,
    num_blobs: u64,
    buf: &mut [u8],
    slot: u64
) -> Result<(u64, u64)>
[src]

pub fn get_index(&self, slot: u64) -> Result<Option<Index>>[src]

pub fn get_coding_blob_bytes(
    &self,
    slot: u64,
    index: u64
) -> Result<Option<Vec<u8>>>
[src]

pub fn delete_coding_blob(&self, slot: u64, blob_index: u64) -> Result<()>[src]

pub fn get_data_blob_bytes(
    &self,
    slot: u64,
    index: u64
) -> Result<Option<Vec<u8>>>
[src]

pub fn put_meta_bytes(&self, slot: u64, bytes: &[u8]) -> Result<()>[src]

Manually update the meta for a slot. Can interfere with automatic meta update and potentially break chaining. Dangerous. Use with care.

pub fn put_data_blob_bytes(
    &self,
    slot: u64,
    index: u64,
    bytes: &[u8]
) -> Result<()>
[src]

For benchmarks, testing, and setup. Does no metadata tracking. Use with care.

pub fn put_coding_blob_bytes_raw(
    &self,
    slot: u64,
    index: u64,
    bytes: &[u8]
) -> Result<()>
[src]

For benchmarks, testing, and setup. Does no metadata tracking. Use with care.

pub fn put_coding_blob(&self, blob: &Blob) -> Result<()>[src]

this function will insert coding blobs and also automatically track erasure-related metadata. If recovery is available it will be done

pub fn put_many_coding_blobs<I>(&self, blobs: I) -> Result<()> where
    I: IntoIterator,
    I::Item: Borrow<Blob>, 
[src]

this function will insert coding blobs and also automatically track erasure-related metadata. If recovery is available it will be done

pub fn put_shared_coding_blobs<I>(&self, shared_blobs: I) -> Result<()> where
    I: IntoIterator,
    I::Item: Borrow<SharedBlob>, 
[src]

pub fn put_many_coding_blob_bytes_raw(
    &self,
    coding_blobs: &[SharedBlob]
) -> Result<()>
[src]

pub fn get_data_blob(&self, slot: u64, blob_index: u64) -> Result<Option<Blob>>[src]

pub fn get_entries_bytes(
    &self,
    _start_index: u64,
    _num_entries: u64,
    _buf: &mut [u8]
) -> Result<(u64, u64)>
[src]

pub fn find_missing_data_indexes(
    &self,
    slot: u64,
    start_index: u64,
    end_index: u64,
    max_missing: usize
) -> Vec<u64>
[src]

pub fn get_slot_entries(
    &self,
    slot: u64,
    blob_start_index: u64,
    max_entries: Option<u64>
) -> Result<Vec<Entry>>
[src]

Returns the entry vector for the slot starting with blob_start_index

pub fn read_ledger_blobs(&self) -> impl Iterator<Item = Blob> + '_[src]

pub fn get_slot_entries_with_blob_count(
    &self,
    slot: u64,
    blob_start_index: u64,
    max_entries: Option<u64>
) -> Result<(Vec<Entry>, usize)>
[src]

pub fn get_slots_since(&self, slots: &[u64]) -> Result<HashMap<u64, Vec<u64>>>[src]

pub fn deserialize_blob_data(data: &[u8]) -> Result<Vec<Entry>>[src]

pub fn is_root(&self, slot: u64) -> bool[src]

pub fn set_roots(&self, rooted_slots: &[u64]) -> Result<()>[src]

pub fn is_dead(&self, slot: u64) -> bool[src]

pub fn set_dead_slot(&self, slot: u64) -> Result<()>[src]

pub fn get_orphans(&self, max: Option<usize>) -> Vec<u64>[src]

pub fn prune(&self, target_slot: u64)[src]

Prune blocktree such that slots higher than target_slot are deleted and all references to higher slots are removed

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err