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; }
Required Methods
fn append_header(&self, header: &str, value: &str, charset: &str)
fn encode(&self, constraint: EncodingConstraint)
Calculates and sets the most efficient Content-Transfer-Encoding
for this Object
and all child parts based on the constraint
provided.
constraint
a EncodingConstraint
fn get_autocrypt_headers(
&self,
effective_date: &DateTime,
matchheader: &str,
addresses: &InternetAddressList,
keep_incomplete: bool
) -> Option<AutocryptHeaderList>
&self,
effective_date: &DateTime,
matchheader: &str,
addresses: &InternetAddressList,
keep_incomplete: bool
) -> Option<AutocryptHeaderList>
fn get_content_disposition(&self) -> Option<ContentDisposition>
Gets the ContentDisposition
for the specified MIME object.
Returns
the ContentDisposition
set on the
MIME object.
fn get_content_disposition_parameter(&self, name: &str) -> Option<String>
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.
fn get_content_id(&self) -> Option<String>
Gets the Content-Id of the MIME object or NULL if one is not set.
Returns
a const pointer to the Content-Id header.
fn get_content_type(&self) -> Option<ContentType>
Gets the ContentType
object for the given MIME object or
None
on fail.
Returns
the content-type object for the specified MIME object.
fn get_content_type_parameter(&self, name: &str) -> Option<String>
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.
fn get_disposition(&self) -> Option<String>
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
.
fn get_header(&self, header: &str) -> Option<String>
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.
fn get_header_list(&self) -> Option<HeaderList>
Get the header list for self
.
Returns
the HeaderList
for self
. Do not
free this pointer when you are done with it.
fn get_headers<'a, P: Into<Option<&'a FormatOptions>>>(
&self,
options: P
) -> Option<String>
&self,
options: P
) -> Option<String>
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.
fn prepend_header(&self, header: &str, value: &str, charset: &str)
fn remove_header(&self, header: &str) -> bool
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.
fn set_content_disposition(&self, disposition: &ContentDisposition)
Set the content disposition for the specified mime part and then serializes it to the Content-Disposition header field.
disposition
a ContentDisposition
object
fn set_content_disposition_parameter(&self, name: &str, value: &str)
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
fn set_content_id(&self, content_id: &str)
fn set_content_type(&self, content_type: &ContentType)
Sets the content-type for the specified MIME object and then serializes it to the Content-Type header field.
content_type
a ContentType
object
fn set_content_type_parameter(&self, name: &str, value: &str)
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
fn set_disposition(&self, disposition: &str)
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")
fn set_header(&self, header: &str, value: &str, charset: &str)
fn to_string<'a, P: Into<Option<&'a FormatOptions>>>(
&self,
options: P
) -> String
&self,
options: P
) -> String
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.
fn write_to_stream<'a, P: Into<Option<&'a FormatOptions>>, Q: IsA<Stream>>(
&self,
options: P,
stream: &Q
) -> isize
&self,
options: P,
stream: &Q
) -> isize
Implementors
impl<O: IsA<Object>> ObjectExt for O