Struct torrent_name_parser::Metadata
source · [−]pub struct Metadata { /* private fields */ }
Implementations
sourceimpl Metadata
impl Metadata
sourcepub fn from(name: &str) -> Result<Self, ErrorMatch>
pub fn from(name: &str) -> Result<Self, ErrorMatch>
use torrent_name_parser::Metadata;
if let Ok(m) = Metadata::from("Doctor.Who.(2003).S01E01.avi") {
assert_eq!(m.title(), "Doctor Who");
assert_eq!(m.season(), Some(1));
assert_eq!(m.extension(), Some("avi"));
assert_eq!(m.is_show(), true);
// Season is not 0 (zero) meaning it is not a Season Special. Eg: Christmas Special
assert_eq!(m.is_special(), false);
}
pub fn title(&self) -> &str
pub fn season(&self) -> Option<i32>
pub fn episode(&self) -> Option<i32>
sourcepub fn episodes(&self) -> &Vec<i32>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn episodes(&self) -> &Vec<i32>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Contains a Vec
of episode numbers detected.
Examples:
No matches -> []
E01
-> [1]
E03e04
-> [3,4]
e03E07
-> [3,4,5,6,7]
pub fn year(&self) -> Option<i32>
pub fn resolution(&self) -> Option<&str>
pub fn quality(&self) -> Option<&str>
pub fn codec(&self) -> Option<&str>
pub fn audio(&self) -> Option<&str>
pub fn group(&self) -> Option<&str>
pub fn imdb_tag(&self) -> Option<&str>
pub fn extended(&self) -> bool
pub fn hardcoded(&self) -> bool
pub fn proper(&self) -> bool
pub fn repack(&self) -> bool
pub fn widescreen(&self) -> bool
pub fn unrated(&self) -> bool
pub fn three_d(&self) -> bool
pub fn extension(&self) -> Option<&str>
pub fn is_show(&self) -> bool
pub fn is_special(&self) -> bool
Trait Implementations
impl Eq for Metadata
impl StructuralEq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more