pub struct ChunkStreamCache(/* private fields */);
Implementations§
Source§impl ChunkStreamCache
impl ChunkStreamCache
pub fn new(chunk: &ChunkId) -> Self
pub fn create_encoder(&self, desc: &ChunkCodecDesc) -> Box<dyn ChunkEncoder>
pub fn loaded(&self) -> bool
pub fn load( &self, finished: bool, raw_cache: Box<dyn RawCache>, ) -> BuckyResult<()>
pub fn chunk(&self) -> &ChunkId
pub fn exists(&self, index: u32) -> BuckyResult<bool>
pub fn len(&self) -> usize
pub async fn wait_exists<T: Future<Output = BuckyError>>( &self, index: u32, abort: T, ) -> BuckyResult<()>
pub async fn async_read<T: Future<Output = BuckyError>>( &self, piece_desc: &PieceDesc, offset_in_piece: usize, buffer: &mut [u8], abort: T, ) -> BuckyResult<usize>
pub fn sync_try_read( &self, piece_desc: &PieceDesc, offset_in_piece: usize, buffer: &mut [u8], ) -> BuckyResult<usize>
Trait Implementations§
Source§impl Clone for ChunkStreamCache
impl Clone for ChunkStreamCache
Source§fn clone(&self) -> ChunkStreamCache
fn clone(&self) -> ChunkStreamCache
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 moreAuto Trait Implementations§
impl Freeze for ChunkStreamCache
impl RefUnwindSafe for ChunkStreamCache
impl Send for ChunkStreamCache
impl Sync for ChunkStreamCache
impl Unpin for ChunkStreamCache
impl UnwindSafe for ChunkStreamCache
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,
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