Skip to main content

PartFlags

Struct PartFlags 

Source
pub struct PartFlags(/* private fields */);
Expand description

What happened while a part was parsed.

Implementations§

Source§

impl PartFlags

Source

pub fn bits(&self) -> u8

The flags as a bit mask.

Source

pub fn is_empty(&self) -> bool

Whether no flag is set.

Source

pub fn contains(&self, other: PartFlags) -> bool

Whether every flag of other is set.

Source

pub fn intersects(&self, other: PartFlags) -> bool

Whether at least one flag of other is set.

Source

pub fn names(&self) -> impl Iterator<Item = &'static str> + use<>

Names of the flags that are set, in bit order.

Source§

impl PartFlags

Source

pub const MISSING_DELIMITER: PartFlags

No delimiter of the enclosing multipart ended this part; it runs to the parent’s next delimiter or to the end of the input. On a multipart: its first delimiter was its close delimiter, so it has no children and its content is the preamble in MessagePart::raw_body.

Source

pub const FALLBACK_DELIMITER: PartFlags

The part ended at a delimiter found in the middle of a line. On a multipart: its first delimiter was found in the middle of a line, because no delimiter at the start of a line opened it (only its close delimiter, or a delimiter of an enclosing multipart, was found).

Source

pub const NO_BLANK_LINE: PartFlags

The header block did not end with a blank line: it runs to the end of the input, or a delimiter cut it, and the body is empty. On a message/rfc822 part that is not PartKind::Message: the nested message was empty or had no header block, so the part keeps its body as text (PartKind::Text, or PartKind::Binary when it was transfer-encoded).

Source

pub const UNTERMINATED: PartFlags

A multipart without its close delimiter. Not set on the multiparts left open when the part limit stopped the parse.

Source

pub const NESTING_LIMIT: PartFlags

A transfer-encoded nested message beyond the encoded nesting limit.

Source

pub const LIMIT_REACHED: PartFlags

A limit was reached here. Depth limit: this multipart or message/rfc822 part was not opened and is kept as a leaf. Part limit: the parse stopped inside this part, which holds the content that was not parsed. That is the last part when it is a leaf child of the innermost open multipart (it then runs to the end of its source), else that multipart, or the message/rfc822 part whose nested message had no part yet; the containers still open all run to the end of their source.

Trait Implementations§

Source§

impl BitOr for PartFlags

Source§

type Output = PartFlags

The resulting type after applying the | operator.
Source§

fn bitor(self, other: PartFlags) -> PartFlags

Performs the | operation. Read more
Source§

impl BitOrAssign for PartFlags

Source§

fn bitor_assign(&mut self, other: PartFlags)

Performs the |= operation. Read more
Source§

impl Clone for PartFlags

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PartFlags

Source§

impl Debug for PartFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PartFlags

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for PartFlags

Source§

impl Hash for PartFlags

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PartFlags

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PartFlags

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.