pub struct StoragePool<S: BlockStore> { /* private fields */ }Expand description
Storage Pool Manager
Manages multiple storage backends with intelligent routing
Implementations§
Source§impl<S: BlockStore> StoragePool<S>
impl<S: BlockStore> StoragePool<S>
Sourcepub fn new(config: PoolConfig) -> Self
pub fn new(config: PoolConfig) -> Self
Create a new storage pool
Sourcepub fn add_backend(&self, config: BackendConfig, store: Arc<S>)
pub fn add_backend(&self, config: BackendConfig, store: Arc<S>)
Add a backend to the pool
Sourcepub fn remove_backend(&self, id: &str) -> Option<Arc<S>>
pub fn remove_backend(&self, id: &str) -> Option<Arc<S>>
Remove a backend from the pool
Sourcepub fn get_backend_config(&self, id: &str) -> Option<BackendConfig>
pub fn get_backend_config(&self, id: &str) -> Option<BackendConfig>
Get backend configuration
Sourcepub fn update_backend_config(
&self,
id: &str,
config: BackendConfig,
) -> Result<()>
pub fn update_backend_config( &self, id: &str, config: BackendConfig, ) -> Result<()>
Update backend configuration
Trait Implementations§
Source§impl<S: BlockStore + Send + Sync + 'static> BlockStore for StoragePool<S>
impl<S: BlockStore + Send + Sync + 'static> BlockStore for StoragePool<S>
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 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 single block
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
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
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
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
Auto Trait Implementations§
impl<S> !Freeze for StoragePool<S>
impl<S> !RefUnwindSafe for StoragePool<S>
impl<S> Send for StoragePool<S>
impl<S> Sync for StoragePool<S>
impl<S> Unpin for StoragePool<S>
impl<S> UnwindSafe for StoragePool<S>where
S: RefUnwindSafe,
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