Struct ipfs_sqlite_block_store::async_block_store::AsyncBlockStore[][src]

pub struct AsyncBlockStore<R> { /* fields omitted */ }

Implementations

impl<R: RuntimeAdapter> AsyncBlockStore<R>[src]

pub fn new(runtime: R, store: BlockStore) -> Self[src]

Wrap a block store in an asyc wrapper

runtime A runtime adapter for your runtime of choice store The BlockStore to wrap

returns the async store and a future that completes when the store is dropped.

pub fn wrap(runtime: R, inner: Arc<Mutex<BlockStore>>) -> Self[src]

Wrap an existing Arc<Mutex>

pub fn inner(&self) -> &Arc<Mutex<BlockStore>>[src]

get the inner Arc<Mutex>

pub fn temp_pin(&self) -> BoxFuture<'static, Result<AsyncTempPin>>[src]

pub fn alias(
    &self,
    name: Vec<u8>,
    link: Option<Cid>
) -> BoxFuture<'static, Result<()>>
[src]

pub fn assign_temp_pin(
    &self,
    pin: AsyncTempPin,
    links: impl IntoIterator<Item = Cid> + Send + 'static
) -> BoxFuture<'static, Result<()>>
[src]

pub fn resolve(&self, name: Vec<u8>) -> BoxFuture<'static, Result<Option<Cid>>>[src]

Resolves an alias to a cid.

pub fn alias_many(
    &self,
    aliases: impl IntoIterator<Item = (impl AsRef<[u8]>, Option<Cid>)> + Send + 'static
) -> BoxFuture<'static, Result<()>>
[src]

pub fn flush(&self) -> BoxFuture<'static, Result<()>>[src]

pub fn gc(&self) -> BoxFuture<'static, Result<()>>[src]

pub async fn incremental_gc(
    &self,
    min_blocks: usize,
    max_duration: Duration
) -> Result<bool>
[src]

pub fn incremental_delete_orphaned(
    &self,
    min_blocks: usize,
    max_duration: Duration
) -> BoxFuture<'static, Result<bool>>
[src]

pub fn get_block(&self, cid: Cid) -> BoxFuture<'static, Result<Option<Vec<u8>>>>[src]

pub fn get_blocks<I: IntoIterator<Item = Cid> + Send + 'static>(
    &self,
    cids: I
) -> BoxFuture<'static, Result<impl Iterator<Item = (Cid, Option<Vec<u8>>)>>>
[src]

pub fn has_block(&self, cid: &Cid) -> BoxFuture<'static, Result<bool>>[src]

pub fn has_blocks<I, O>(&self, cids: I) -> BoxFuture<'static, Result<O>> where
    I: IntoIterator<Item = Cid> + Send + 'static,
    O: FromIterator<(Cid, bool)> + Send + 'static, 
[src]

pub fn has_cid(&self, cid: Cid) -> BoxFuture<'static, Result<bool>>[src]

pub fn get_missing_blocks<C: FromIterator<Cid> + Send + 'static>(
    &self,
    cid: Cid
) -> BoxFuture<'static, Result<C>>
[src]

pub fn get_descendants<C: FromIterator<Cid> + Send + 'static>(
    &self,
    cid: Cid
) -> BoxFuture<'static, Result<C>>
[src]

pub fn reverse_alias(
    &self,
    cid: Cid
) -> BoxFuture<'static, Result<Option<Vec<Vec<u8>>>>>
[src]

pub fn get_known_cids<C: FromIterator<Cid> + Send + 'static>(
    &self
) -> BoxFuture<'static, Result<C>>
[src]

pub fn get_block_cids<C: FromIterator<Cid> + Send + 'static>(
    &self
) -> BoxFuture<'static, Result<C>>
[src]

pub fn get_store_stats(&self) -> BoxFuture<'static, Result<StoreStats>>[src]

pub fn put_blocks<B: Block + Send + 'static>(
    &self,
    blocks: impl IntoIterator<Item = B> + Send + 'static,
    alias: Option<AsyncTempPin>
) -> BoxFuture<'static, Result<()>>
[src]

pub fn put_block(
    &self,
    block: impl Block + Send + 'static,
    alias: Option<&AsyncTempPin>
) -> BoxFuture<'static, Result<()>>
[src]

pub async fn gc_loop(self, config: GcConfig) -> Result<()>[src]

A gc loop that runs incremental gc in regular intervals

Gc will run as long as this future is polled. GC is a two step process. First, the metadata of expendable non-pinned blocks will be deleted, then the actual data will be removed. This will run the first step and the second step interleaved to minimize gc interruptions.

impl<R> AsyncBlockStore<R>[src]

pub fn ref_count(&self) -> usize[src]

number of references to this async wrapper

Trait Implementations

impl<R: Clone> Clone for AsyncBlockStore<R>[src]

Auto Trait Implementations

impl<R> !RefUnwindSafe for AsyncBlockStore<R>[src]

impl<R> Send for AsyncBlockStore<R> where
    R: Send
[src]

impl<R> Sync for AsyncBlockStore<R> where
    R: Sync
[src]

impl<R> Unpin for AsyncBlockStore<R> where
    R: Unpin
[src]

impl<R> !UnwindSafe for AsyncBlockStore<R>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> References<RawCodec> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.