pub struct StorageManager { /* private fields */ }Expand description
Storage manager with caching and retry logic
Provides a high-level interface for storage operations with:
- In-memory caching for frequently accessed objects
- Automatic retry on transient failures
- Bandwidth throttling
- Metrics collection
Implementations§
Source§impl StorageManager
impl StorageManager
Sourcepub fn new(backend: Box<dyn StorageBackend>) -> Self
pub fn new(backend: Box<dyn StorageBackend>) -> Self
Sourcepub fn with_cache_size(self, size_bytes: usize) -> Self
pub fn with_cache_size(self, size_bytes: usize) -> Self
Set the cache size limit
Sourcepub fn with_retry_count(self, count: u32) -> Self
pub fn with_retry_count(self, count: u32) -> Self
Set the retry count for failed operations
Sourcepub fn list(&self, prefix: &str) -> Result<Vec<StorageObject>>
pub fn list(&self, prefix: &str) -> Result<Vec<StorageObject>>
List objects with the specified prefix
Sourcepub fn get_metadata(&self, key: &str) -> Result<StorageObject>
pub fn get_metadata(&self, key: &str) -> Result<StorageObject>
Get metadata about a stored object
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache
Sourcepub fn stats(&self) -> &StorageStats
pub fn stats(&self) -> &StorageStats
Get storage statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics
Auto Trait Implementations§
impl Freeze for StorageManager
impl !RefUnwindSafe for StorageManager
impl Send for StorageManager
impl Sync for StorageManager
impl Unpin for StorageManager
impl UnsafeUnpin for StorageManager
impl !UnwindSafe for StorageManager
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> 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