pub struct SledBlockStore { /* private fields */ }Expand description
Block storage using Sled embedded database
Implementations§
Source§impl SledBlockStore
impl SledBlockStore
Sourcepub fn new(config: BlockStoreConfig) -> Result<Self>
pub fn new(config: BlockStoreConfig) -> Result<Self>
Create a new block store
Trait Implementations§
Source§impl BlockStore for SledBlockStore
impl BlockStore for SledBlockStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 Block,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 Block,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a block
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Option<Block>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Option<Block>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a block by CID
Source§fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a block exists
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a block
Source§fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
blocks: &'life1 [Block],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
blocks: &'life1 [Block],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store multiple blocks atomically using Sled’s batch API
Source§fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Block>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Block>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve multiple blocks efficiently
Source§fn has_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if multiple blocks exist efficiently
Source§fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete multiple blocks atomically
Auto Trait Implementations§
impl Freeze for SledBlockStore
impl !RefUnwindSafe for SledBlockStore
impl Send for SledBlockStore
impl Sync for SledBlockStore
impl Unpin for SledBlockStore
impl !UnwindSafe for SledBlockStore
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> StreamingBlockStore for Twhere
T: BlockStore,
impl<T> StreamingBlockStore for Twhere
T: BlockStore,
Source§fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Option<PartialBlock>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Option<PartialBlock>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a partial block (range-based) Read more