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 Forget for PullBody
impl Move for PullBody
impl RefUnwindSafe for PullBodywhere
Mutex<BodyInner>: RefUnwindSafe,
impl Send for PullBody
impl Sync for PullBody
impl Unpin for PullBody
impl UnsafeUnpin for PullBodywhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const ArcInner<Shared> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ObjectName>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
*const ErrorResponse is !null: UnsafeUnpin,
PhantomData<ErrorResponse>: UnsafeUnpin,
*const () is !null: UnsafeUnpin,
PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin,
*const ArcInner<Gate> is !null: UnsafeUnpin,
PhantomData<ArcInner<Gate>>: UnsafeUnpin,
impl UnwindSafe for PullBodywhere
Mutex<BodyInner>: UnwindSafe,
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