Trait gmime::HeaderExt[][src]

pub trait HeaderExt {
    fn format_addrlist<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn format_content_disposition<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn format_content_type<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn format_default<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn format_message_id<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn format_received<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn format_references<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    ) -> Option<String>;
fn get_name(&self) -> Option<String>;
fn get_offset(&self) -> i64;
fn get_raw_name(&self) -> Option<String>;
fn get_raw_value(&self) -> Option<String>;
fn get_value(&self) -> Option<String>;
fn set_raw_value(&self, raw_value: &str);
fn set_value<'a, P: Into<Option<&'a FormatOptions>>>(
        &self,
        options: P,
        value: &str,
        charset: &str
    );
fn write_to_stream<'a, P: Into<Option<&'a FormatOptions>>, Q: IsA<Stream>>(
        &self,
        options: P,
        stream: &Q
    ) -> isize; }

Trait containing all Header methods.

Implementors

Header

Required Methods

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a Sender, From, Reply-To, To, Cc, or Bcc header value

charset

a charset (note: unused)

Returns

a newly allocated string containing the reformatted value.

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a Content-Disposition header value

charset

a charset (note: unused)

Returns

a newly allocated string containing the reformatted value.

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a Content-Type header value

charset

a charset (note: unused)

Returns

a newly allocated string containing the reformatted value.

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a header value

charset

a charset to use when encoding the value

Returns

a newly allocated string containing the reformatted value.

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a Message-Id or Content-Id header value

charset

a charset (note: unused)

Returns

a newly allocated string containing the reformatted value.

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a Received header value

charset

a charset (note: unused)

Returns

a newly allocated string containing the reformatted value.

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

options

a FormatOptions or None

value

a References or In-Reply-To header value

charset

a charset (note: unused)

Returns

a newly allocated string containing the reformatted value.

Gets the header's name.

Returns

the header name or None if invalid.

Gets the header's stream offset if known.

Returns

the header offset or %-1 if unknown.

Gets the header's raw name. The raw header name is the complete string up to (but not including) the ':' separating the header's name from its value. This string may be different from the value returned by HeaderExt::get_name if the parsed message's header contained trailing whitespace after the header name, such as: "Subject : this is the subject\r\n".

Returns

the raw header name.

Gets the header's raw (folded) value.

Returns

the header value or None if invalid.

Gets the header's unfolded value.

Returns

the header's decoded value or None if invalid.

Sets the header's raw value.

raw_value

the raw value

Sets the header's decoded value.

options

a FormatOptions or None

value

the new header value

charset

a charset

Write the header to the specified stream.

options

a FormatOptions or None

stream

a Stream

Returns

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

Implementors