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.
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.
Put a block
This will only be completed once the transaction is successfully committed.
Get the stats for the store
The stats are kept up to date, so this is fast.
pub fn put_blocks<I>(
&mut self,
blocks: I,
pin: Option<&mut TempPin>
) -> Result<()> where
I: IntoIterator<Item = Block<S>>,
Auto Trait Implementations
impl<S> !RefUnwindSafe for BlockStore<S>
impl<S> Send for BlockStore<S> where
S: Send,
impl<S> !Sync for BlockStore<S>
impl<S> Unpin for BlockStore<S> where
S: Unpin,
impl<S> !UnwindSafe for BlockStore<S>
Blanket Implementations
Mutably borrows from an owned value. Read more
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