Struct google_apis_common::MultiPartReader
source · 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 more