pub struct Metadata { /* private fields */ }

Implementations§

source§

impl Metadata

source

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);
 }
source

pub fn title(&self) -> &str

source

pub fn season(&self) -> Option<i32>

source

pub fn episode(&self) -> Option<i32>

source

pub fn episodes(&self) -> &Vec<i32>

Contains a Vec of episode numbers detected.

Examples:

No matches -> []
E01 -> [1]
E03e04 -> [3,4]
e03E07 -> [3,4,5,6,7]

source

pub fn year(&self) -> Option<i32>

source

pub fn resolution(&self) -> Option<&str>

source

pub fn quality(&self) -> Option<&str>

source

pub fn codec(&self) -> Option<&str>

source

pub fn audio(&self) -> Option<&str>

source

pub fn group(&self) -> Option<&str>

source

pub fn country(&self) -> Option<&str>

source

pub fn imdb_tag(&self) -> Option<&str>

source

pub fn extended(&self) -> bool

source

pub fn hardcoded(&self) -> bool

source

pub fn proper(&self) -> bool

source

pub fn repack(&self) -> bool

source

pub fn widescreen(&self) -> bool

source

pub fn unrated(&self) -> bool

source

pub fn three_d(&self) -> bool

source

pub fn extension(&self) -> Option<&str>

source

pub fn is_show(&self) -> bool

source

pub fn is_special(&self) -> bool

source

pub fn language(&self) -> Option<&str>

Trait Implementations§

source§

impl Clone for Metadata

source§

fn clone(&self) -> Metadata

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metadata

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Metadata

source§

fn default() -> Metadata

Returns the “default value” for a type. Read more
source§

impl FromStr for Metadata

§

type Err = ErrorMatch

The associated error which can be returned from parsing.
source§

fn from_str(name: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<Metadata> for Metadata

source§

fn eq(&self, other: &Metadata) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&str> for Metadata

§

type Error = ErrorMatch

The type returned in the event of a conversion error.
source§

fn try_from(s: &str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Metadata

source§

impl StructuralEq for Metadata

source§

impl StructuralPartialEq for Metadata

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.