Struct ipfs_sqlite_block_store::async_block_store::AsyncBlockStore [−][src]
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]
&self,
name: Vec<u8>,
link: Option<Cid>
) -> BoxFuture<'static, Result<()>>
pub fn assign_temp_pin(
&self,
pin: AsyncTempPin,
links: impl IntoIterator<Item = Cid> + Send + 'static
) -> BoxFuture<'static, Result<()>>
[src]
&self,
pin: AsyncTempPin,
links: impl IntoIterator<Item = Cid> + Send + 'static
) -> BoxFuture<'static, Result<()>>
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]
&self,
aliases: impl IntoIterator<Item = (impl AsRef<[u8]>, Option<Cid>)> + Send + 'static
) -> BoxFuture<'static, Result<()>>
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]
&self,
min_blocks: usize,
max_duration: Duration
) -> Result<bool>
pub fn incremental_delete_orphaned(
&self,
min_blocks: usize,
max_duration: Duration
) -> BoxFuture<'static, Result<bool>>
[src]
&self,
min_blocks: usize,
max_duration: Duration
) -> BoxFuture<'static, Result<bool>>
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]
&self,
cids: I
) -> BoxFuture<'static, Result<impl Iterator<Item = (Cid, Option<Vec<u8>>)>>>
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]
I: IntoIterator<Item = Cid> + Send + 'static,
O: FromIterator<(Cid, bool)> + Send + 'static,
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]
&self,
cid: Cid
) -> BoxFuture<'static, Result<C>>
pub fn get_descendants<C: FromIterator<Cid> + Send + 'static>(
&self,
cid: Cid
) -> BoxFuture<'static, Result<C>>
[src]
&self,
cid: Cid
) -> BoxFuture<'static, Result<C>>
pub fn reverse_alias(
&self,
cid: Cid
) -> BoxFuture<'static, Result<Option<Vec<Vec<u8>>>>>
[src]
&self,
cid: Cid
) -> BoxFuture<'static, Result<Option<Vec<Vec<u8>>>>>
pub fn get_known_cids<C: FromIterator<Cid> + Send + 'static>(
&self
) -> BoxFuture<'static, Result<C>>
[src]
&self
) -> BoxFuture<'static, Result<C>>
pub fn get_block_cids<C: FromIterator<Cid> + Send + 'static>(
&self
) -> BoxFuture<'static, Result<C>>
[src]
&self
) -> BoxFuture<'static, Result<C>>
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]
&self,
blocks: impl IntoIterator<Item = B> + Send + 'static,
alias: Option<AsyncTempPin>
) -> BoxFuture<'static, Result<()>>
pub fn put_block(
&self,
block: impl Block + Send + 'static,
alias: Option<&AsyncTempPin>
) -> BoxFuture<'static, Result<()>>
[src]
&self,
block: impl Block + Send + 'static,
alias: Option<&AsyncTempPin>
) -> BoxFuture<'static, Result<()>>
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]
Trait Implementations
impl<R: Clone> Clone for AsyncBlockStore<R>
[src]
fn clone(&self) -> AsyncBlockStore<R>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<R> !RefUnwindSafe for AsyncBlockStore<R>
[src]
impl<R> Send for AsyncBlockStore<R> where
R: Send,
[src]
R: Send,
impl<R> Sync for AsyncBlockStore<R> where
R: Sync,
[src]
R: Sync,
impl<R> Unpin for AsyncBlockStore<R> where
R: Unpin,
[src]
R: Unpin,
impl<R> !UnwindSafe for AsyncBlockStore<R>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> References<RawCodec> for T
pub fn references<R, E>(
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
R: Read,
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
R: Read,
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,