Struct ipfs_sqlite_block_store::BlockStore[][src]

pub struct BlockStore<S> { /* fields omitted */ }

Implementations

Create another connection to the underlying database

This allows you to perform operations in parallel.

Create an in memory block store with the given config

Create a persistent block store with the given config

Open the file at the given path for testing.

This will create a writeable in-memory database that is initialized with the content of the file at the given path.

Get a temporary alias for safely adding blocks to the store

Run a full VACUUM on the SQLITE database

This may take a while, blocking all other writes to the store.

Perform maintenance on the TempPins

This is done automatically upon every (incremental) GC, so you normally don’t need to call this.

Perform full GC

This is the same as running incremental GC without limits, plus a full SQLITE VACUUM.

Perform an incremental garbage collection.

Will collect unpinned blocks until either the size targets are met again, or at minimum min_blocks blocks are collected. Then it will continue connecting blocks until max_duration is elapsed.

Note that this might significantly exceed max_duration for various reasons.

Returns true if either size targets are met or there are no unpinned blocks left.

Set or delete an alias

Returns the aliases referencing a cid

Resolves an alias to a cid

Extend temp pin with an additional cid

Checks if the store knows about the cid.

Note that this does not necessarily mean that the store has the data for the cid.

Checks if the store has the data for a cid

Get all cids that the store knows about

Get all cids for which the store has blocks

Get descendants of a cid

Given a root of a dag, gives all cids which we do not have data for.

list all aliases

Put a block

This will only be completed once the transaction is successfully committed.

Get a block

Get the stats for the store

The stats are kept up to date, so this is fast.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Scrape the references from an impl Read. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more