Struct google_apis_common::XUploadContentType
source · pub struct XUploadContentType(pub Mime);
Expand description
The X-Upload-Content-Type
header.
Generated via rustc –pretty expanded -Z unstable-options, and manually processed to be more readable.
Tuple Fields§
§0: Mime
Methods from Deref<Target = Mime>§
sourcepub fn type_(&self) -> Name<'_>
pub fn type_(&self) -> Name<'_>
Get the top level media type for this Mime
.
Example
let mime = mime::TEXT_PLAIN;
assert_eq!(mime.type_(), "text");
assert_eq!(mime.type_(), mime::TEXT);
sourcepub fn subtype(&self) -> Name<'_>
pub fn subtype(&self) -> Name<'_>
Get the subtype of this Mime
.
Example
let mime = mime::TEXT_PLAIN;
assert_eq!(mime.subtype(), "plain");
assert_eq!(mime.subtype(), mime::PLAIN);
sourcepub fn suffix(&self) -> Option<Name<'_>>
pub fn suffix(&self) -> Option<Name<'_>>
Get an optional +suffix for this Mime
.
Example
let svg = "image/svg+xml".parse::<mime::Mime>().unwrap();
assert_eq!(svg.suffix(), Some(mime::XML));
assert_eq!(svg.suffix().unwrap(), "xml");
assert!(mime::TEXT_PLAIN.suffix().is_none());
sourcepub fn get_param<'a, N>(&'a self, attr: N) -> Option<Name<'a>>
pub fn get_param<'a, N>(&'a self, attr: N) -> Option<Name<'a>>
Look up a parameter by name.
Example
let mime = mime::TEXT_PLAIN_UTF_8;
assert_eq!(mime.get_param(mime::CHARSET), Some(mime::UTF_8));
assert_eq!(mime.get_param("charset").unwrap(), "utf-8");
assert!(mime.get_param("boundary").is_none());
let mime = "multipart/form-data; boundary=ABCDEFG".parse::<mime::Mime>().unwrap();
assert_eq!(mime.get_param(mime::BOUNDARY).unwrap(), "ABCDEFG");
sourcepub fn essence_str(&self) -> &str
pub fn essence_str(&self) -> &str
Return a &str
of the Mime’s “essence”.
Trait Implementations§
source§impl Clone for XUploadContentType
impl Clone for XUploadContentType
source§fn clone(&self) -> XUploadContentType
fn clone(&self) -> XUploadContentType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for XUploadContentType
impl Debug for XUploadContentType
source§impl Deref for XUploadContentType
impl Deref for XUploadContentType
source§impl DerefMut for XUploadContentType
impl DerefMut for XUploadContentType
source§impl Display for XUploadContentType
impl Display for XUploadContentType
source§impl PartialEq for XUploadContentType
impl PartialEq for XUploadContentType
source§fn eq(&self, other: &XUploadContentType) -> bool
fn eq(&self, other: &XUploadContentType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for XUploadContentType
impl StructuralEq for XUploadContentType
impl StructuralPartialEq for XUploadContentType
Auto Trait Implementations§
impl RefUnwindSafe for XUploadContentType
impl Send for XUploadContentType
impl Sync for XUploadContentType
impl Unpin for XUploadContentType
impl UnwindSafe for XUploadContentType
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.