pub struct DiskPieceReader { /* private fields */ }Expand description
Wrapper data structure that can be used to read pieces from single disk farm
Implementations§
Source§impl DiskPieceReader
impl DiskPieceReader
Sourcepub async fn read_piece(
&self,
sector_index: SectorIndex,
piece_offset: PieceOffset,
) -> Option<Piece>
pub async fn read_piece( &self, sector_index: SectorIndex, piece_offset: PieceOffset, ) -> Option<Piece>
Read piece from sector by offset, None means input parameters are incorrect or piece
reader was shut down
Trait Implementations§
Source§impl Clone for DiskPieceReader
impl Clone for DiskPieceReader
Source§fn clone(&self) -> DiskPieceReader
fn clone(&self) -> DiskPieceReader
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 DiskPieceReader
impl Debug for DiskPieceReader
Source§impl PieceReader for DiskPieceReader
impl PieceReader for DiskPieceReader
Source§fn read_piece<'life0, 'async_trait>(
&'life0 self,
sector_index: SectorIndex,
piece_offset: PieceOffset,
) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_piece<'life0, 'async_trait>(
&'life0 self,
sector_index: SectorIndex,
piece_offset: PieceOffset,
) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, FarmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read piece from sector by offset,
None means input parameters are incorrect or piece
reader was shut downAuto Trait Implementations§
impl Freeze for DiskPieceReader
impl !RefUnwindSafe for DiskPieceReader
impl Send for DiskPieceReader
impl Sync for DiskPieceReader
impl Unpin for DiskPieceReader
impl !UnwindSafe for DiskPieceReader
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