pub struct AtBlobHeader<R: RecvStream = RecvStream> { /* private fields */ }
Expand description
State before reading a size header
Implementations§
Source§impl<R: RecvStream> AtBlobHeader<R>
impl<R: RecvStream> AtBlobHeader<R>
Sourcepub async fn next(
self,
) -> Result<(AtBlobContent<R>, u64), AtBlobHeaderNextError>
pub async fn next( self, ) -> Result<(AtBlobContent<R>, u64), AtBlobHeaderNextError>
Read the size header, returning it and going into the Content
state.
Sourcepub async fn drain(self) -> Result<AtEndBlob<R>, DecodeError>
pub async fn drain(self) -> Result<AtEndBlob<R>, DecodeError>
Drain the response and throw away the result
Sourcepub async fn concatenate_into_vec(
self,
) -> Result<(AtEndBlob<R>, Vec<u8>), DecodeError>
pub async fn concatenate_into_vec( self, ) -> Result<(AtEndBlob<R>, Vec<u8>), DecodeError>
Concatenate the entire response into a vec
For a request that does not request the complete blob, this will just concatenate the ranges that were requested.
Sourcepub async fn write_all<D: AsyncSliceWriter>(
self,
data: D,
) -> Result<AtEndBlob<R>, DecodeError>
pub async fn write_all<D: AsyncSliceWriter>( self, data: D, ) -> Result<AtEndBlob<R>, DecodeError>
Write the entire blob to a slice writer.
Sourcepub async fn write_all_with_outboard<D, O>(
self,
outboard: Option<O>,
data: D,
) -> Result<AtEndBlob<R>, DecodeError>where
D: AsyncSliceWriter,
O: OutboardMut,
pub async fn write_all_with_outboard<D, O>(
self,
outboard: Option<O>,
data: D,
) -> Result<AtEndBlob<R>, DecodeError>where
D: AsyncSliceWriter,
O: OutboardMut,
Write the entire blob to a slice writer and to an optional outboard.
The outboard is only written to if the blob is larger than a single chunk group.
Sourcepub fn ranges(&self) -> &ChunkRanges
pub fn ranges(&self) -> &ChunkRanges
The ranges we have requested for the current hash.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for AtBlobHeader<R>where
R: Freeze,
impl<R> RefUnwindSafe for AtBlobHeader<R>where
R: RefUnwindSafe,
impl<R> Send for AtBlobHeader<R>
impl<R> Sync for AtBlobHeader<R>where
R: Sync,
impl<R> Unpin for AtBlobHeader<R>where
R: Unpin,
impl<R> UnwindSafe for AtBlobHeader<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