pub struct PullBody { /* private fields */ }Expand description
The body of a reply to get or
list_refs.
A PullBody is an AsyncRead. A read gives the bytes of the body until
the chunk that ends it, and then end of file. When a read meets that
chunk, the session moves to the next reply. The body is Send + Sync.
§Failures
Each of these events in a read ends the session:
- a body that is longer than the
max_lenof its call - a body whose stated length is different from the sum of its chunks
- an
Errormessage after the abandon marker - a failed read
The read then fails with an io::Error that carries the Error of the
session, and each later read fails the same way. If that error is an
Error::Io, the io::Error has its kind. Otherwise the kind is
Other.
The session can also fail for another reason, for example a dropped
get or list_refs future, or StreamSession::finish. A later read
of the body then fails with the first failure and reads no more of the
body. A drop of the body before its end also ends the session.
Implementations§
Trait Implementations§
Source§impl AsyncRead for PullBody
impl AsyncRead for PullBody
Auto Trait Implementations§
impl !Freeze for PullBody
impl RefUnwindSafe for PullBody
impl Send for PullBody
impl Sync for PullBody
impl Unpin for PullBody
impl UnsafeUnpin for PullBody
impl UnwindSafe for PullBody
Blanket Implementations§
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> ⓘwhere
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> ⓘwhere
Self: Unpin,
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self> ⓘwhere
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self> ⓘwhere
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self> ⓘwhere
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self> ⓘwhere
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self> ⓘwhere
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self> ⓘwhere
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> ⓘwhere
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> ⓘwhere
Self: Unpin,
buf. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit bytes from it. Read more