pub struct Options {
pub allowed_delimiters: Vec<char>,
pub ignored_strings: Vec<String>,
pub parse_episode_number: bool,
pub parse_episode_title: bool,
pub parse_file_extension: bool,
pub parse_release_group: bool,
}
Expand description
The options used by Anitomy to determine how to parse a filename.
Fields
allowed_delimiters: Vec<char>
ignored_strings: Vec<String>
parse_episode_number: bool
parse_episode_title: bool
parse_file_extension: bool
parse_release_group: bool
Implementations
sourceimpl Options
impl Options
sourcepub fn new<S: AsRef<str>>(
allowed_delimiters: &[char],
ignored_strings: &[S],
parse_episode_number: bool,
parse_episode_title: bool,
parse_file_extension: bool,
parse_release_group: bool
) -> Self
pub fn new<S: AsRef<str>>(
allowed_delimiters: &[char],
ignored_strings: &[S],
parse_episode_number: bool,
parse_episode_title: bool,
parse_file_extension: bool,
parse_release_group: bool
) -> Self
Construct a new instance of Options with the given settings.
sourcepub fn allow_delimiter(&mut self, delimiter: char) -> &mut Self
pub fn allow_delimiter(&mut self, delimiter: char) -> &mut Self
Adds a delimiter char to the list of allowed delimiters.
sourcepub fn allow_delimiters(&mut self, delimiters: &[char]) -> &mut Self
pub fn allow_delimiters(&mut self, delimiters: &[char]) -> &mut Self
Replaces the list of allowed delimiters.
sourcepub fn ignore_string<S: AsRef<str>>(&mut self, string: S) -> &mut Self
pub fn ignore_string<S: AsRef<str>>(&mut self, string: S) -> &mut Self
Adds a string to the list of ignored strings.
sourcepub fn ignore_strings<S: AsRef<str>>(&mut self, strings: &[S]) -> &mut Self
pub fn ignore_strings<S: AsRef<str>>(&mut self, strings: &[S]) -> &mut Self
Replaces the list of ignored strings.
sourcepub fn parse_episode_number(&mut self, parse: bool) -> &mut Self
pub fn parse_episode_number(&mut self, parse: bool) -> &mut Self
Sets whether Anitomy should attempt to parse the episode number.
sourcepub fn parse_episode_title(&mut self, parse: bool) -> &mut Self
pub fn parse_episode_title(&mut self, parse: bool) -> &mut Self
Sets whether Anitomy should attempt to parse the episode title.
sourcepub fn parse_file_extension(&mut self, parse: bool) -> &mut Self
pub fn parse_file_extension(&mut self, parse: bool) -> &mut Self
Sets whether Anitomy should attempt to parse the file extension.
sourcepub fn parse_release_group(&mut self, parse: bool) -> &mut Self
pub fn parse_release_group(&mut self, parse: bool) -> &mut Self
Sets whether Anitomy should attempt to parse the release group.
Trait Implementations
sourceimpl Default for Options
impl Default for Options
sourcefn default() -> Self
fn default() -> Self
Constructs a new instance of Options with the Anitomy defaults.
Equivalent to:
ⓘ
Options {
allowed_delimiters: vec![' ', '_', '.', '&', '+', ',', '|'],
ignored_strings: vec![],
parse_episode_number: true,
parse_episode_title: true,
parse_file_extension: true,
parse_release_group: true,
}
impl Eq for Options
impl StructuralEq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more