pub struct BlockReader { /* private fields */ }Expand description
Reads by ledger sequence.
The reader knows the segments as of the last directory scan; new
blocks appended by the loader become visible after refresh. get
calls it itself when the ledger is past the known end.
Implementations§
Source§impl BlockReader
impl BlockReader
pub fn open(dir: &Path) -> Result<BlockReader, String>
Sourcepub fn get(&self, sequence: u32) -> Result<Option<Vec<u8>>, String>
pub fn get(&self, sequence: u32) -> Result<Option<Vec<u8>>, String>
Serialized ledger by sequence; None if there is no such ledger.
Sourcepub fn bytes_on_disk(&self, dir: &Path) -> u64
pub fn bytes_on_disk(&self, dir: &Path) -> u64
Bytes taken by segments, indexes and the dictionary.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BlockReader
impl RefUnwindSafe for BlockReader
impl Send for BlockReader
impl Sync for BlockReader
impl Unpin for BlockReader
impl UnsafeUnpin for BlockReader
impl UnwindSafe for BlockReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].