Skip to main content

Pool

Struct Pool 

Source
pub struct Pool { /* private fields */ }

Implementations§

Source§

impl Pool

Source

pub fn open( path: impl AsRef<Path>, budget: usize, max_prepares: usize, ) -> Result<Self, String>

budget bounds the estimated bytes of cached prepared blocks; one block is always kept even if it alone exceeds the budget.

Source

pub fn seal(&self, threads: usize) -> Result<Vec<Vec<[u8; 32]>>, String>

Checks every block in full, on up to threads threads, and returns the seal: the digests of every block, in directory order.

Source

pub fn set_seal(&mut self, seal: Vec<Vec<[u8; 32]>>) -> Result<(), String>

Sets the seal from seal (as returned by seal for this archive). A seal with the wrong number of digests is refused.

Source

pub fn first(&self) -> Option<u32>

Source

pub fn cached_bytes(&self) -> usize

Bytes of cached prepared blocks and remembered transaction hashes.

Source

pub fn block_id(&self, seq: u32) -> Result<usize, String>

Index of the block holding ledger seq: callers group reads by it.

Source

pub fn ledger(&self, seq: u32) -> Result<Row, String>

Source

pub fn header(&self, seq: u32) -> Result<Vec<u8>, String>

Header of ledger seq only.

Source

pub fn ledger_txs(&self, seq: u32) -> Result<Row, String>

Ledger seq with transactions but no patches (patches is empty).

Source

pub fn tx(&self, seq: u32, within: usize) -> Result<(Vec<u8>, Vec<u8>), String>

Transaction at original storage position within of ledger seq.

Source

pub fn tx_with_index( &self, seq: u32, index: u32, ) -> Result<Option<TxAt>, String>

Transaction of ledger seq whose metadata has TransactionIndex index, with the ledger’s header; for a JC06 block only the part holding the ledger is compiled.

Trait Implementations§

Source§

impl Debug for Pool

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Pool

§

impl RefUnwindSafe for Pool

§

impl Send for Pool

§

impl Sync for Pool

§

impl Unpin for Pool

§

impl UnsafeUnpin for Pool

§

impl UnwindSafe for Pool

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.