Skip to main content

SubjectParts

Struct SubjectParts 

Source
pub struct SubjectParts {
    pub base_subject: String,
    pub part_index: Option<u32>,
    pub part_total: Option<u32>,
}
Expand description

Fields extracted from a parsed Usenet/email subject line.

Returned by parse_subject. The base_subject field can be used as a stable grouping key across parts of the same series.

§Field invariants

  • base_subject is never empty when SubjectParts is returned (the only way to get an empty or no-marker subject back is if parse_subject returns Some with part_index = None).
  • part_total is always Some when part_index is Some, because every supported marker format includes the total count.

Fields§

§base_subject: String

Subject line with the part-number marker removed and surrounding whitespace trimmed. Safe to use as a collection grouping key because all parts of the same series share the same base subject.

§part_index: Option<u32>

1-based part number extracted from the marker. Some(0) indicates a TOC post (e.g. (00/17)). None when no recognised marker was found.

§part_total: Option<u32>

Total number of parts as declared in the subject marker. Always Some when part_index is Some; None otherwise.

Trait Implementations§

Source§

impl Debug for SubjectParts

Source§

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

Formats the value using the given formatter. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.