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); }

Trait containing all ContentType methods.

Implementors

ContentType

Required Methods

Encodes the Content-Disposition header.

options

a FormatOptions or None

Returns

a new string containing the encoded header value.

Gets the Content-Type's media sub-type.

Returns

the Content-Type's media sub-type.

Gets the Content-Type's media type.

Returns

the Content-Type's media type.

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.

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.

Gets the Content-Type's parameter list.

Returns

the Content-Type's parameter list.

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.

Sets the Content-Type's media subtype.

subtype

media subtype

Sets the Content-Type's media type.

type_

media type

Sets a parameter on the Content-Type.

Note: The name should be in US-ASCII while the value should be in UTF-8.

name

parameter name (aka attribute)

value

parameter value

Implementors