Struct fvm_ipld_blockstore::tracking::TrackingBlockstore

source ·
pub struct TrackingBlockstore<BS> {
    pub stats: RefCell<BSStats>,
    /* private fields */
}
Expand description

Wrapper around Blockstore to tracking reads and writes for verification. This struct should only be used for testing.

Fields§

§stats: RefCell<BSStats>

Implementations§

source§

impl<BS> TrackingBlockstore<BS>
where BS: Blockstore,

source

pub fn new(base: BS) -> Self

Trait Implementations§

source§

impl<BS> Blockstore for TrackingBlockstore<BS>
where BS: Blockstore,

source§

fn get(&self, cid: &Cid) -> Result<Option<Vec<u8>>>

Gets the block from the blockstore.
source§

fn has(&self, cid: &Cid) -> Result<bool>

Checks if the blockstore has the specified block.
source§

fn put<D>(&self, code: Code, block: &Block<D>) -> Result<Cid>
where D: AsRef<[u8]>,

Puts the block into the blockstore, computing the hash with the specified multicodec. Read more
source§

fn put_keyed(&self, k: &Cid, block: &[u8]) -> Result<()>

Put a block with a pre-computed cid. Read more
source§

fn put_many<D, I>(&self, blocks: I) -> Result<()>
where Self: Sized, D: AsRef<[u8]>, I: IntoIterator<Item = (Code, Block<D>)>,

Bulk put blocks into the blockstore. Read more
source§

fn put_many_keyed<D, I>(&self, blocks: I) -> Result<()>
where Self: Sized, D: AsRef<[u8]>, I: IntoIterator<Item = (Cid, D)>,

Bulk-put pre-keyed blocks into the blockstore. Read more
source§

impl<BS: Debug> Debug for TrackingBlockstore<BS>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<BS> !Freeze for TrackingBlockstore<BS>

§

impl<BS> !RefUnwindSafe for TrackingBlockstore<BS>

§

impl<BS> Send for TrackingBlockstore<BS>
where BS: Send,

§

impl<BS> !Sync for TrackingBlockstore<BS>

§

impl<BS> Unpin for TrackingBlockstore<BS>
where BS: Unpin,

§

impl<BS> UnwindSafe for TrackingBlockstore<BS>
where BS: UnwindSafe,

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

§

type Output = T

Should always be Self
source§

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

§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V