pub struct SingleDiskPieceCache { /* private fields */ }Expand description
Dedicated piece cache stored on one disk, is used both to accelerate DSN queries and to plot faster
Trait Implementations§
Source§impl Clone for SingleDiskPieceCache
impl Clone for SingleDiskPieceCache
Source§fn clone(&self) -> SingleDiskPieceCache
fn clone(&self) -> SingleDiskPieceCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SingleDiskPieceCache
impl Debug for SingleDiskPieceCache
Source§impl PieceCache for SingleDiskPieceCache
impl PieceCache for SingleDiskPieceCache
Source§fn id(&self) -> &PieceCacheId
fn id(&self) -> &PieceCacheId
ID of this cache
Source§fn max_num_elements(&self) -> u32
fn max_num_elements(&self) -> u32
Max number of elements in this cache
Source§fn contents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<(PieceCacheOffset, Option<PieceIndex>), FarmError>> + Unpin + Send + '_>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn contents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<(PieceCacheOffset, Option<PieceIndex>), FarmError>> + Unpin + Send + '_>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Contents of this piece cache. Read more
Source§fn write_piece<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: PieceCacheOffset,
piece_index: PieceIndex,
piece: &'life1 Piece,
) -> Pin<Box<dyn Future<Output = Result<(), FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_piece<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: PieceCacheOffset,
piece_index: PieceIndex,
piece: &'life1 Piece,
) -> Pin<Box<dyn Future<Output = Result<(), FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store piece in cache at specified offset, replacing existing piece if there is one. Read more
Source§fn read_piece_index<'life0, 'async_trait>(
&'life0 self,
offset: PieceCacheOffset,
) -> Pin<Box<dyn Future<Output = Result<Option<PieceIndex>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_piece_index<'life0, 'async_trait>(
&'life0 self,
offset: PieceCacheOffset,
) -> Pin<Box<dyn Future<Output = Result<Option<PieceIndex>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read piece index from cache at specified offset. Read more
Source§fn read_piece<'life0, 'async_trait>(
&'life0 self,
offset: PieceCacheOffset,
) -> Pin<Box<dyn Future<Output = Result<Option<(PieceIndex, Piece)>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_piece<'life0, 'async_trait>(
&'life0 self,
offset: PieceCacheOffset,
) -> Pin<Box<dyn Future<Output = Result<Option<(PieceIndex, Piece)>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read piece from cache at specified offset. Read more
Source§fn read_pieces<'life0, 'async_trait>(
&'life0 self,
offsets: Box<dyn Iterator<Item = PieceCacheOffset> + Send>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<(PieceCacheOffset, Option<(PieceIndex, Piece)>), FarmError>> + Send + Unpin + '_>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_pieces<'life0, 'async_trait>(
&'life0 self,
offsets: Box<dyn Iterator<Item = PieceCacheOffset> + Send>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<(PieceCacheOffset, Option<(PieceIndex, Piece)>), FarmError>> + Send + Unpin + '_>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read pieces from cache at specified offsets. Read more
Auto Trait Implementations§
impl Freeze for SingleDiskPieceCache
impl !RefUnwindSafe for SingleDiskPieceCache
impl Send for SingleDiskPieceCache
impl Sync for SingleDiskPieceCache
impl Unpin for SingleDiskPieceCache
impl !UnwindSafe for SingleDiskPieceCache
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more