Trait melib::thread::SubjectPrefix

source ·
pub trait SubjectPrefix {
    const USUAL_PREFIXES: &'static [&'static str] = _;

    // Required methods
    fn is_a_reply(&self) -> bool;
    fn strip_prefixes(&mut self) -> &mut Self;
    fn strip_prefixes_from_list(
        &mut self,
        list: &[&str],
        times: Option<u8>
    ) -> &mut Self;
}
Expand description

Strip common prefixes from subjects

use melib::thread::SubjectPrefix;

let mut subject = "Re: RE: Res: Re: Res: Subject";
assert_eq!(
    subject.strip_prefixes_from_list(<&str>::USUAL_PREFIXES, None),
    &"Subject"
);
let mut subject = "Re: RE: Res: Re: Res: Subject";
assert_eq!(
    subject.strip_prefixes_from_list(<&str>::USUAL_PREFIXES, Some(1)),
    &"RE: Res: Re: Res: Subject"
);

Provided Associated Constants§

source

const USUAL_PREFIXES: &'static [&'static str] = _

Required Methods§

source

fn is_a_reply(&self) -> bool

source

fn strip_prefixes(&mut self) -> &mut Self

source

fn strip_prefixes_from_list( &mut self, list: &[&str], times: Option<u8> ) -> &mut Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl SubjectPrefix for &str

source§

fn is_a_reply(&self) -> bool

source§

fn strip_prefixes(&mut self) -> &mut Self

source§

fn strip_prefixes_from_list( &mut self, list: &[&str], times: Option<u8> ) -> &mut Self

source§

impl SubjectPrefix for &[u8]

source§

fn is_a_reply(&self) -> bool

source§

fn strip_prefixes(&mut self) -> &mut Self

source§

fn strip_prefixes_from_list( &mut self, list: &[&str], times: Option<u8> ) -> &mut Self

Implementors§