Trait gmime::HeaderListExt[][src]

pub trait HeaderListExt {
    fn append(&self, name: &str, value: &str, charset: &str);
fn clear(&self);
fn contains(&self, name: &str) -> bool;
fn get_count(&self) -> i32;
fn get_header(&self, name: &str) -> Option<Header>;
fn get_header_at(&self, index: i32) -> Option<Header>;
fn prepend(&self, name: &str, value: &str, charset: &str);
fn remove(&self, name: &str) -> bool;
fn remove_at(&self, index: i32);
fn set(&self, name: &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 HeaderList methods.

Implementors

HeaderList

Required Methods

Appends a header. If value is None, a space will be set aside for it (useful for setting the order of headers before values can be obtained for them) otherwise the header will be unset.

name

header name

value

header value

charset

a charset

Removes all of the headers from the HeaderList.

Checks whether or not a header exists.

name

header name

Returns

true if the specified header exists or false otherwise.

Gets the number of headers contained within the header list.

Returns

the number of headers in the header list.

Gets the first header with the specified name.

name

header name

Returns

a Header for the specified name.

Gets the header at the specified index within the list.

index

the 0-based index of the header

Returns

the header at position index.

Prepends a header. If value is None, a space will be set aside for it (useful for setting the order of headers before values can be obtained for them) otherwise the header will be unset.

name

header name

value

header value

charset

a charset

Remove the first instance of the specified header.

name

header name

Returns

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

Removes the header at the specified index from self.

index

the 0-based index of the header to remove

Set the value of the specified header. If value is None and the header, name, had not been previously set, a space will be set aside for it (useful for setting the order of headers before values can be obtained for them) otherwise the header will be unset.

Note: If there are multiple headers with the specified field name, the first instance of the header will be replaced and further instances will be removed.

name

header name

value

header value

charset

a charset

Allocates a string buffer containing the raw rfc822 headers contained in self.

options

a FormatOptions or None

Returns

a string containing the header block.

Write the headers to a stream.

options

a FormatOptions or None

stream

output stream

Returns

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

Implementors