pub struct CachedPeerStorage { /* private fields */ }Expand description
Storage decorator that caches blob reads while always delegating roots.
Implementations§
Source§impl CachedPeerStorage
impl CachedPeerStorage
Sourcepub fn open(
storage: Arc<dyn PeerStorage>,
config: &SegmentCacheConfig,
) -> Result<Self>
pub fn open( storage: Arc<dyn PeerStorage>, config: &SegmentCacheConfig, ) -> Result<Self>
Opens a cache around peer storage.
§Errors
Returns an error for invalid configuration, inaccessible storage, or an already-owned cache directory.
Sourcepub fn metrics(&self) -> Arc<SegmentCacheMetrics>
pub fn metrics(&self) -> Arc<SegmentCacheMetrics>
Returns cache counters for a metrics adapter.
Trait Implementations§
Source§impl PeerStorage for CachedPeerStorage
impl PeerStorage for CachedPeerStorage
Source§impl SegmentReader for CachedPeerStorage
impl SegmentReader for CachedPeerStorage
Source§fn read_segment<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlobId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_segment<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 BlobId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads an immutable segment from authoritative storage.
Auto Trait Implementations§
impl !Freeze for CachedPeerStorage
impl !RefUnwindSafe for CachedPeerStorage
impl !UnwindSafe for CachedPeerStorage
impl Send for CachedPeerStorage
impl Sync for CachedPeerStorage
impl Unpin for CachedPeerStorage
impl UnsafeUnpin for CachedPeerStorage
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request