Trait gmime::ObjectExt[][src]

pub trait ObjectExt {
    fn append_header(&self, header: &str, value: &str, charset: &str);
fn encode(&self, constraint: EncodingConstraint);
fn get_autocrypt_headers(
        &self,
        effective_date: &DateTime,
        matchheader: &str,
        addresses: &InternetAddressList,
        keep_incomplete: bool
    ) -> Option<AutocryptHeaderList>;
fn get_content_disposition(&self) -> Option<ContentDisposition>;
fn get_content_disposition_parameter(&self, name: &str) -> Option<String>;
fn get_content_id(&self) -> Option<String>;
fn get_content_type(&self) -> Option<ContentType>;
fn get_content_type_parameter(&self, name: &str) -> Option<String>;
fn get_disposition(&self) -> Option<String>;
fn get_header(&self, header: &str) -> Option<String>;
fn get_header_list(&self) -> Option<HeaderList>;
fn get_headers<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P
    ) -> Option<String>;
fn prepend_header(&self, header: &str, value: &str, charset: &str);
fn remove_header(&self, header: &str) -> bool;
fn set_content_disposition(&self, disposition: &ContentDisposition);
fn set_content_disposition_parameter(&self, name: &str, value: &str);
fn set_content_id(&self, content_id: &str);
fn set_content_type(&self, content_type: &ContentType);
fn set_content_type_parameter(&self, name: &str, value: &str);
fn set_disposition(&self, disposition: &str);
fn set_header(&self, header: &str, value: &str, charset: &str);
fn to_string<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P
    ) -> String;
fn write_to_stream<'a, P: Into<Option<&'a FormatOptions>>, Q: IsA<Stream>>(
        &self,
        options: P,
        stream: &Q
    ) -> isize; }

Trait containing all Object methods.

Implementors

MessagePart, Message, Multipart, Object, Part

Required Methods

Appends a new header to the header list.

header name

value

header value

charset

a charset

Calculates and sets the most efficient Content-Transfer-Encoding for this Object and all child parts based on the constraint provided.

constraint

a EncodingConstraint

Gets the ContentDisposition for the specified MIME object.

Returns

the ContentDisposition set on the MIME object.

Gets the value of the Content-Disposition parameter specified by name, or None if the parameter does not exist.

name

parameter name

Returns

the value of the requested content-disposition param or None if the param doesn't exist. If the param is set, the returned string will be in UTF-8.

Gets the Content-Id of the MIME object or NULL if one is not set.

Returns

a const pointer to the Content-Id header.

Gets the ContentType object for the given MIME object or None on fail.

Returns

the content-type object for the specified MIME object.

Gets the value of the content-type param name set on the MIME part self.

name

param name

Returns

the value of the requested content-type param or None if the param doesn't exist. If the param is set, the returned string will be in UTF-8.

Gets the MIME object's disposition if set or None otherwise.

Returns

the disposition string which is probably one of GMIME_DISPOSITION_ATTACHMENT or GMIME_DISPOSITION_INLINE.

Gets the value of the first header with the specified name.

header

header name

Returns

the value of the requested header if it exists or None otherwise.

Get the header list for self.

Returns

the HeaderList for self. Do not free this pointer when you are done with it.

Allocates a string buffer containing all of the MIME object's raw headers.

options

a FormatOptions or None

Returns

an allocated string containing all of the raw MIME headers.

Note: The returned string will not be suitable for display.

Prepends a new header to the header list.

header

header name

value

header value

charset

a charset

Removed the specified header if it exists.

header

header name

Returns

true if the header was removed or false if it could not be found.

Set the content disposition for the specified mime part and then serializes it to the Content-Disposition header field.

disposition

a ContentDisposition object

Add a content-disposition parameter to the specified mime part.

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

name

parameter name

value

parameter value

Sets the Content-Id of the MIME object.

content_id

content-id (addr-spec portion)

Sets the content-type for the specified MIME object and then serializes it to the Content-Type header field.

content_type

a ContentType object

Sets the content-type param name to the value value.

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

name

param name

value

param value

Sets the disposition to disposition which may be one of GMIME_DISPOSITION_ATTACHMENT or GMIME_DISPOSITION_INLINE or, by your choice, any other string which would indicate how the MIME part should be displayed by the MUA.

disposition

disposition ("attachment" or "inline")

Sets a header to the specified value.

header

header name

value

header value

charset

a charset

Allocates a string buffer containing the contents of self.

options

a FormatOptions or None

Returns

an allocated string containing the contents of the mime object.

Write the contents of the MIME object to stream.

options

a FormatOptions or None

stream

stream

Returns

the number of bytes written or %-1 on fail.

Implementors