pub struct StorageService<S: StoreParams> { /* private fields */ }
Implementations§
Source§impl<S: StoreParams> StorageService<S>
impl<S: StoreParams> StorageService<S>
pub fn open( config: &Config, cache_size: usize, sweep_interval: Option<Duration>, ) -> Result<Self>
pub fn atime(&self) -> u64
pub async fn evict(&self, grace_atime: u64) -> Result<()>
pub async fn flush(&self) -> Result<()>
pub fn iter(&self) -> impl Iterator<Item = Result<Cid>>
Trait Implementations§
Source§impl<S: StoreParams> Storage<S> for StorageService<S>
impl<S: StoreParams> Storage<S> for StorageService<S>
type Subscription = Subscription
fn contains(&self, cid: &Cid) -> Result<bool>
fn get(&self, cid: &Cid) -> Result<Option<Vec<u8>>>
fn insert(&self, block: &Block<S>) -> Result<()>
fn alias<'life0, 'life1, 'async_trait, T>( &'life0 self, alias: T, cid: Option<&'life1 Cid>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn resolve<T: AsRef<[u8]> + Send + Sync>(&self, alias: T) -> Result<Option<Cid>>
fn pinned<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe(&self) -> Self::Subscription
Auto Trait Implementations§
impl<S> Freeze for StorageService<S>
impl<S> !RefUnwindSafe for StorageService<S>
impl<S> Send for StorageService<S>
impl<S> Sync for StorageService<S>
impl<S> Unpin for StorageService<S>
impl<S> !UnwindSafe for StorageService<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more