Struct gmime::ParserOptions [−]
pub struct ParserOptions(_);
A set of parser options used by Parser
and various other parsing functions.
Methods
impl ParserOptions
[src]
impl ParserOptions
pub fn new() -> ParserOptions
[src]
pub fn new() -> ParserOptions
Creates a new set of ParserOptions
.
Returns
a newly allocated set of ParserOptions
with the default values.
pub fn clone(&mut self) -> Option<ParserOptions>
[src]
pub fn clone(&mut self) -> Option<ParserOptions>
pub fn get_address_compliance_mode(&mut self) -> RfcComplianceMode
[src]
pub fn get_address_compliance_mode(&mut self) -> RfcComplianceMode
Gets the compliance mode that should be used when parsing rfc822 addresses.
Note: Even in RfcComplianceMode::Strict
mode, the address parser is fairly liberal in
what it accepts. Setting it to RfcComplianceMode::Loose
just makes it try harder to
deal with garbage input.
Returns
the compliance mode that is currently set.
pub fn get_allow_addresses_without_domain(&mut self) -> bool
[src]
pub fn get_allow_addresses_without_domain(&mut self) -> bool
Gets whether or not the rfc822 address parser should allow addresses without a domain.
In general, you'll probably want this value to be false
(the default) as it allows
maximum interoperability with existing (broken) mail clients and other mail software
such as sloppily written perl scripts (aka spambots) that do not properly quote the
name when it contains a comma.
This option exists in order to allow parsing of mailbox addresses that do not have a domain component. These types of addresses are rare and were typically only used when sending mail to other users on the same UNIX system.
Returns
true
if the address parser should allow addresses without a domain.
pub fn get_fallback_charsets(&mut self) -> Vec<String>
[src]
pub fn get_fallback_charsets(&mut self) -> Vec<String>
Gets the fallback charsets to try when decoding 8-bit headers.
Returns
a None
-terminated list of charsets to try when
decoding 8-bit headers.
pub fn get_parameter_compliance_mode(&mut self) -> RfcComplianceMode
[src]
pub fn get_parameter_compliance_mode(&mut self) -> RfcComplianceMode
Gets the compliance mode that should be used when parsing Content-Type and Content-Disposition parameters.
Note: Even in RfcComplianceMode::Strict
mode, the parameter parser is fairly liberal
in what it accepts. Setting it to RfcComplianceMode::Loose
just makes it try harder
to deal with garbage input.
Returns
the compliance mode that is currently set.
pub fn get_rfc2047_compliance_mode(&mut self) -> RfcComplianceMode
[src]
pub fn get_rfc2047_compliance_mode(&mut self) -> RfcComplianceMode
Gets the compliance mode that should be used when parsing rfc2047 encoded words.
Note: Even in RfcComplianceMode::Strict
mode, the rfc2047 parser is fairly liberal
in what it accepts. Setting it to RfcComplianceMode::Loose
just makes it try harder
to deal with garbage input.
Returns
the compliance mode that is currently set.
pub fn set_address_compliance_mode(&mut self, mode: RfcComplianceMode)
[src]
pub fn set_address_compliance_mode(&mut self, mode: RfcComplianceMode)
Sets the compliance mode that should be used when parsing rfc822 addresses.
In general, you'll probably want this value to be RfcComplianceMode::Loose
(the default) as it allows maximum interoperability with existing (broken) mail clients
and other mail software such as sloppily written perl scripts (aka spambots).
Note: Even in RfcComplianceMode::Strict
mode, the address parser is fairly liberal in
what it accepts. Setting it to RfcComplianceMode::Loose
just makes it try harder to
deal with garbage input.
mode
a RfcComplianceMode
pub fn set_allow_addresses_without_domain(&mut self, allow: bool)
[src]
pub fn set_allow_addresses_without_domain(&mut self, allow: bool)
Sets whether the rfc822 address parser should allow addresses without a domain.
In general, you'll probably want this value to be false
(the default) as it allows
maximum interoperability with existing (broken) mail clients and other mail software
such as sloppily written perl scripts (aka spambots) that do not properly quote the
name when it contains a comma.
This option exists in order to allow parsing of mailbox addresses that do not have a domain component. These types of addresses are rare and were typically only used when sending mail to other users on the same UNIX system.
allow
true
if the parser should allow addresses without a domain or false
otherwise
pub fn set_fallback_charsets(&mut self, charsets: &Vec<&str>)
[src]
pub fn set_fallback_charsets(&mut self, charsets: &Vec<&str>)
Sets the fallback charsets to try when decoding 8-bit headers.
Note: It is recommended that the list of charsets start with utf-8 and end with iso-8859-1.
charsets
a None
-terminated list of charsets or None
for the default list
pub fn set_parameter_compliance_mode(&mut self, mode: RfcComplianceMode)
[src]
pub fn set_parameter_compliance_mode(&mut self, mode: RfcComplianceMode)
Sets the compliance mode that should be used when parsing Content-Type and Content-Disposition parameters.
In general, you'll probably want this value to be RfcComplianceMode::Loose
(the default) as it allows maximum interoperability with existing (broken) mail clients
and other mail software such as sloppily written perl scripts (aka spambots).
Note: Even in RfcComplianceMode::Strict
mode, the parameter parser is fairly liberal
in what it accepts. Setting it to RfcComplianceMode::Loose
just makes it try harder
to deal with garbage input.
mode
a RfcComplianceMode
pub fn set_rfc2047_compliance_mode(&mut self, mode: RfcComplianceMode)
[src]
pub fn set_rfc2047_compliance_mode(&mut self, mode: RfcComplianceMode)
Sets the compliance mode that should be used when parsing rfc2047 encoded words.
In general, you'll probably want this value to be RfcComplianceMode::Loose
(the default) as it allows maximum interoperability with existing (broken) mail clients
and other mail software such as sloppily written perl scripts (aka spambots).
Note: Even in RfcComplianceMode::Strict
mode, the parameter parser is fairly liberal
in what it accepts. Setting it to RfcComplianceMode::Loose
just makes it try harder
to deal with garbage input.
mode
a RfcComplianceMode
pub fn get_default() -> Option<ParserOptions>
[src]
pub fn get_default() -> Option<ParserOptions>
Trait Implementations
impl Clone for ParserOptions
impl Clone for ParserOptions
fn clone(&self) -> ParserOptions
fn clone(&self) -> ParserOptions
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ParserOptions
impl Debug for ParserOptions
fn fmt(&self, __arg_0: &mut Formatter) -> Result
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl StaticType for ParserOptions
impl StaticType for ParserOptions
fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Default for ParserOptions
[src]
impl Default for ParserOptions
Auto Trait Implementations
impl !Send for ParserOptions
impl !Send for ParserOptions
impl !Sync for ParserOptions
impl !Sync for ParserOptions