Trait gmime::AutocryptHeaderExt [−][src]
pub trait AutocryptHeaderExt { fn clone(&self, src: &AutocryptHeader); fn get_address(&self) -> Option<InternetAddressMailbox>; fn get_address_as_string(&self) -> Option<String>; fn get_effective_date(&self) -> Option<DateTime>; fn get_keydata(&self) -> Option<Bytes>; fn get_prefer_encrypt(&self) -> AutocryptPreferEncrypt; fn is_complete(&self) -> bool; fn set_address(&self, address: &InternetAddressMailbox); fn set_address_from_string(&self, address: &str); fn set_effective_date(&self, effective_date: &DateTime); fn set_keydata(&self, data: &Bytes); fn set_prefer_encrypt(&self, pref: AutocryptPreferEncrypt); fn to_string(&self, gossip: bool) -> String; }
Required Methods
fn clone(&self, src: &AutocryptHeader)
If address and type already match between src
and self
, copy
keydata, prefer_encrypt, effective_date from src
to self
.
src
a AutocryptHeader
object
fn get_address(&self) -> Option<InternetAddressMailbox>
Gets the internal address of the Autocrypt header, or None
if not set.
Returns
the address associated with the Autocrypt header
fn get_address_as_string(&self) -> Option<String>
Gets the internal address of the Autocrypt header as a C string, or None
if not set.
Returns
the address associated with the Autocrypt header
fn get_effective_date(&self) -> Option<DateTime>
Gets the effective date of the Autocrypt header, or None
if not set.
Returns
the effective date associated with the Autocrypt header
fn get_keydata(&self) -> Option<Bytes>
Gets the raw keydata of the Autocrypt header, or None
if not set.
Returns
the raw key data associated with the Autocrypt header
fn get_prefer_encrypt(&self) -> AutocryptPreferEncrypt
Gets the encryption preference stated by the Autocrypt header.
Returns
the encryption preference associated with the Autocrypt header
fn is_complete(&self) -> bool
When dealing with Autocrypt headers derived from a message, some sender addresses will not have a legitimate/complete header associated with them. When a given sender address has no complete header of a specific type, it should "reset" the state of the associated address.
Returns
true
if the header is complete, or false
if it is incomplete.
fn set_address(&self, address: &InternetAddressMailbox)
fn set_address_from_string(&self, address: &str)
Set the address associated with the autocrypt_header.
address
a None
-terminated string that is a raw e-mail address
fn set_effective_date(&self, effective_date: &DateTime)
fn set_keydata(&self, data: &Bytes)
Set the raw key data associated with the Autocrypt header.
fn set_prefer_encrypt(&self, pref: AutocryptPreferEncrypt)
Set the encryption preference associated with the Autocrypt header.
pref
a AutocryptPreferEncrypt
value
fn to_string(&self, gossip: bool) -> String
Gets the string representation of the Autocrypt header, or None
on
error. For example, it might return:
prefer-encrypt=mutual; addr=bob@example.com; keydata=AAAB15BE...
If you are using this object to populate an Autocrypt-Gossip
header, you should set gossip
to true
(this will suppress
inclusion of prefer-encrypt).
gossip
a gboolean
, indicating whether this header is for use with gossip
Returns
the string representation of the Autocrypt header.
Implementors
impl<O: IsA<AutocryptHeader>> AutocryptHeaderExt for O