pub struct ResponseDecoder<R>(/* private fields */);
Expand description
Response decoder
Implementations§
Source§impl<R: AsyncStreamReader> ResponseDecoder<R>
impl<R: AsyncStreamReader> ResponseDecoder<R>
Sourcepub fn new(hash: Hash, ranges: ChunkRanges, tree: BaoTree, encoded: R) -> Self
pub fn new(hash: Hash, ranges: ChunkRanges, 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.
Sourcepub async fn next(self) -> ResponseDecoderNext<R>
pub async fn next(self) -> ResponseDecoderNext<R>
Proceed to the next state by reading the next chunk from the stream.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for ResponseDecoder<R>
impl<R> RefUnwindSafe for ResponseDecoder<R>where
R: RefUnwindSafe,
impl<R> Send for ResponseDecoder<R>where
R: Send,
impl<R> Sync for ResponseDecoder<R>where
R: Sync,
impl<R> Unpin for ResponseDecoder<R>
impl<R> UnwindSafe for ResponseDecoder<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