pub struct MultiPartReader<'a> { /* private fields */ }
Expand description
Provides a Read
interface that converts multiple parts into the protocol
identified by RFC2387.
Note: This implementation is just as rich as it needs to be to perform uploads
to google APIs, and might not be a fully-featured implementation.
Implementations§
source§impl<'a> MultiPartReader<'a>
impl<'a> MultiPartReader<'a>
sourcepub fn mime_type() -> Mime
pub fn mime_type() -> Mime
Returns the mime-type representing our multi-part message. Use it with the ContentType header.
sourcepub fn reserve_exact(&mut self, cap: usize)
pub fn reserve_exact(&mut self, cap: usize)
Reserve memory for exactly the given amount of parts
sourcepub fn add_part(
&mut self,
reader: &'a mut (dyn Read + Send),
size: u64,
mime_type: Mime,
) -> &mut MultiPartReader<'a> ⓘ
pub fn add_part( &mut self, reader: &'a mut (dyn Read + Send), size: u64, mime_type: Mime, ) -> &mut MultiPartReader<'a> ⓘ
Add a new part to the queue of parts to be read on the first read
call.
§Arguments
headers
- identifying the body of the part. It’s similar to the header
in an ordinary single-part call, and should thus contain the
same information.
reader
- a reader providing the part’s body
size
- the amount of bytes provided by the reader. It will be put onto the header as
content-size.
mime
- It will be put onto the content type
Trait Implementations§
source§impl<'a> Default for MultiPartReader<'a>
impl<'a> Default for MultiPartReader<'a>
source§impl<'a> Read for MultiPartReader<'a>
impl<'a> Read for MultiPartReader<'a>
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read
, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf
. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf
. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf
. Read moresource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)cursor
. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read
. Read moreAuto Trait Implementations§
impl<'a> Freeze for MultiPartReader<'a>
impl<'a> !RefUnwindSafe for MultiPartReader<'a>
impl<'a> Send for MultiPartReader<'a>
impl<'a> !Sync for MultiPartReader<'a>
impl<'a> Unpin for MultiPartReader<'a>
impl<'a> !UnwindSafe for MultiPartReader<'a>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more