[][src]Trait ipfs_sqlite_block_store::async_block_store::RuntimeAdapter

pub trait RuntimeAdapter {
    pub fn unblock<F, T>(&self, f: F) -> BoxFuture<'_, T>
    where
        F: FnOnce() -> T + Send + 'static,
        T: Send + 'static
;
pub fn sleep(&self, duration: Duration) -> BoxFuture<'_, ()>; }

Adapter for a runtime such as tokio or async_std

Required methods

pub fn unblock<F, T>(&self, f: F) -> BoxFuture<'_, T> where
    F: FnOnce() -> T + Send + 'static,
    T: Send + 'static, 
[src]

run a blocking block of code, most likely involving IO, on a different thread.

pub fn sleep(&self, duration: Duration) -> BoxFuture<'_, ()>[src]

sleep for the given duration

Loading content...

Implementors

Loading content...