Trait gmime::ContentTypeExt [−][src]
pub trait ContentTypeExt {
fn encode<'a, P: Into<Option<&'a FormatOptions>>>(
&self,
options: P
) -> Option<String>;
fn get_media_subtype(&self) -> Option<String>;
fn get_media_type(&self) -> Option<String>;
fn get_mime_type(&self) -> Option<String>;
fn get_parameter(&self, name: &str) -> Option<String>;
fn get_parameters(&self) -> Option<ParamList>;
fn is_type(&self, type_: &str, subtype: &str) -> bool;
fn set_media_subtype(&self, subtype: &str);
fn set_media_type(&self, type_: &str);
fn set_parameter(&self, name: &str, value: &str);
}Required Methods
fn encode<'a, P: Into<Option<&'a FormatOptions>>>(
&self,
options: P
) -> Option<String>
&self,
options: P
) -> Option<String>
Encodes the Content-Disposition header.
options
a FormatOptions or None
Returns
a new string containing the encoded header value.
fn get_media_subtype(&self) -> Option<String>
fn get_media_type(&self) -> Option<String>
fn get_mime_type(&self) -> Option<String>
Allocates a string buffer containing the type and subtype defined
by the self.
Returns
an allocated string containing the type and subtype of the content-type in the format: type/subtype.
fn get_parameter(&self, name: &str) -> Option<String>
Gets the parameter value specified by name if it's available.
name
parameter name (aka attribute)
Returns
the value of the requested parameter or None if the
parameter is not set. If the parameter is set, the returned string
will be in UTF-8.
fn get_parameters(&self) -> Option<ParamList>
fn is_type(&self, type_: &str, subtype: &str) -> bool
Compares the given type and subtype with that of the given mime type object.
type_
MIME type to compare against
subtype
MIME subtype to compare against
Returns
true if the MIME types match or false otherwise. You may
use "*" in place of type_ and/or subtype as a wilcard.
fn set_media_subtype(&self, subtype: &str)
fn set_media_type(&self, type_: &str)
fn set_parameter(&self, name: &str, value: &str)
Implementors
impl<O: IsA<ContentType>> ContentTypeExt for O