pub struct PoolStore { /* private fields */ }Implementations§
Source§impl PoolStore
impl PoolStore
pub fn maintain( &self, max_items: usize, ) -> Result<PoolMaintenanceReport, StoreError>
Source§impl PoolStore
impl PoolStore
pub fn balance_temperature(&self) -> Result<PoolTemperatureReport, StoreError>
Source§impl PoolStore
impl PoolStore
pub fn open<P: AsRef<Path>>( path: P, config: PoolStoreConfig, ) -> Result<Self, StoreError>
pub fn add_member( &self, config: PoolMemberConfig, ) -> Result<PoolMemberId, StoreError>
pub fn begin_drain(&self, id: PoolMemberId) -> Result<(), StoreError>
pub fn update_member_limits( &self, id: PoolMemberId, capacity_bytes: u64, max_read_concurrency: u32, max_write_concurrency: u32, ) -> Result<(), StoreError>
pub fn update_member_temperature_watermarks( &self, id: PoolMemberId, low_percent: u8, high_percent: u8, ) -> Result<(), StoreError>
pub fn remove_member(&self, id: PoolMemberId) -> Result<(), StoreError>
pub fn member(&self, id: PoolMemberId) -> Result<PoolMemberStatus, StoreError>
pub fn members(&self) -> Result<Vec<PoolMemberStatus>, StoreError>
pub fn blob_location( &self, hash: &Hash, ) -> Result<Option<PoolMemberId>, StoreError>
pub fn put_sync(&self, hash: Hash, data: &[u8]) -> Result<bool, StoreError>
pub fn put_many_report_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<PutManyReport, StoreError>
pub fn put_many_sync( &self, items: &[(Hash, Vec<u8>)], ) -> Result<usize, StoreError>
pub fn get_sync(&self, hash: &Hash) -> Result<Option<Vec<u8>>, StoreError>
pub fn get_range_sync( &self, hash: &Hash, start: u64, end_inclusive: u64, ) -> Result<Option<Vec<u8>>, StoreError>
pub fn blob_size_sync(&self, hash: &Hash) -> Result<Option<u64>, StoreError>
pub fn exists(&self, hash: &Hash) -> Result<bool, StoreError>
pub fn existing_hashes_in_sorted_candidates( &self, sorted_hashes: &[Hash], ) -> Result<Vec<bool>, StoreError>
Sourcepub fn largest_member_map_size_bytes(&self) -> Result<Option<usize>, StoreError>
pub fn largest_member_map_size_bytes(&self) -> Result<Option<usize>, StoreError>
Largest map size among members that are available in this process.
The pool catalog is a separate LMDB environment and is intentionally not reported as blob capacity.
pub fn delete_sync(&self, hash: &Hash) -> Result<bool, StoreError>
pub fn pin_sync(&self, hash: &Hash) -> Result<(), StoreError>
pub fn unpin_sync(&self, hash: &Hash) -> Result<(), StoreError>
pub fn pin_count_sync(&self, hash: &Hash) -> Result<u32, StoreError>
pub fn touch_accessed_sync( &self, hash: &Hash, now: u64, ) -> Result<bool, StoreError>
pub fn touch_many_accessed_sync( &self, hashes: &[Hash], now: u64, ) -> Result<usize, StoreError>
pub fn last_accessed_at_sync( &self, hash: &Hash, ) -> Result<Option<u64>, StoreError>
pub fn many_last_accessed_at_sync( &self, hashes: &[Hash], ) -> Result<Vec<(Hash, u64)>, StoreError>
pub fn list(&self) -> Result<Vec<Hash>, StoreError>
pub fn stats(&self) -> Result<StoreStats, StoreError>
pub fn force_sync(&self) -> Result<(), StoreError>
Trait Implementations§
Source§impl Store for PoolStore
impl Store for PoolStore
Source§fn put<'life0, 'async_trait>(
&'life0 self,
hash: Hash,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
hash: Hash,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store data by its hash
Returns true if newly stored, false if already existed
Source§fn put_many<'life0, 'async_trait>(
&'life0 self,
items: Vec<(Hash, Vec<u8>)>,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_many<'life0, 'async_trait>(
&'life0 self,
items: Vec<(Hash, Vec<u8>)>,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store multiple blobs.
Returns the number of newly stored items.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve data by hash
Returns data or None if not found
Source§fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
start: u64,
end_inclusive: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
start: u64,
end_inclusive: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a byte range from a blob by hash. Read more
Source§fn blob_size<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn blob_size<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the stored blob size in bytes. Read more
Source§fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if hash exists
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete by hash
Returns true if deleted, false if didn’t exist
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StoreStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StoreStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get storage statistics
Source§fn pin<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pin<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pin a hash (increment ref count). Pinned items are not evicted.
Source§fn unpin<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unpin<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unpin a hash (decrement ref count). Item can be evicted when count reaches 0.
Source§fn set_max_bytes(&self, _max: u64)
fn set_max_bytes(&self, _max: u64)
Set maximum storage size in bytes. 0 = unlimited.
Source§fn evict_if_needed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn evict_if_needed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Evict unpinned items if over storage limit.
Returns number of bytes freed.
Auto Trait Implementations§
impl Freeze for PoolStore
impl RefUnwindSafe for PoolStore
impl Send for PoolStore
impl Sync for PoolStore
impl Unpin for PoolStore
impl UnsafeUnpin for PoolStore
impl UnwindSafe for PoolStore
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