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§
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
Object Safety§
This trait is not object safe.