Struct bao_tree::io::fsm::ResponseDecoderReading
source · pub struct ResponseDecoderReading<R>(_);Expand description
Response decoder state machine, after reading the size
Implementations§
source§impl<R: AsyncRead + Unpin> ResponseDecoderReading<R>
impl<R: AsyncRead + Unpin> ResponseDecoderReading<R>
sourcepub fn new(
hash: Hash,
ranges: RangeSet2<ChunkNum>,
tree: BaoTree,
encoded: R
) -> Self
pub fn new( hash: Hash, ranges: RangeSet2<ChunkNum>, tree: BaoTree, encoded: R ) -> Self
Create a new response decoder state machine, when you have already read the size.
The size as well as the chunk size is given in the tree parameter.
pub async fn next( self ) -> ResponseDecoderReadingNext<(Self, Result<DecodeResponseItem, DecodeError>), R>
pub fn finish(self) -> R
Trait Implementations§
Auto Trait Implementations§
impl<R> RefUnwindSafe for ResponseDecoderReading<R>where R: RefUnwindSafe,
impl<R> Send for ResponseDecoderReading<R>where R: Send,
impl<R> Sync for ResponseDecoderReading<R>where R: Sync,
impl<R> Unpin for ResponseDecoderReading<R>
impl<R> UnwindSafe for ResponseDecoderReading<R>where R: UnwindSafe,
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