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_subjectis never empty whenSubjectPartsis returned (the only way to get an empty or no-marker subject back is ifparse_subjectreturnsSomewithpart_index = None).part_totalis alwaysSomewhenpart_indexisSome, because every supported marker format includes the total count.
Fields§
§base_subject: StringSubject 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§
Auto Trait Implementations§
impl Freeze for SubjectParts
impl RefUnwindSafe for SubjectParts
impl Send for SubjectParts
impl Sync for SubjectParts
impl Unpin for SubjectParts
impl UnsafeUnpin for SubjectParts
impl UnwindSafe for SubjectParts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more