[−][src]Struct omdbrs::Film
Structure for holding information about a Film.
Stores information about a film as retrieved from the OMDb. Should be
constructed using either from_title()
or from_id()
. This information can
be accessed using the included getters. All information is stored as
Strings.
Examples
To create a Film object representing the film Shrek:
use omdbrs::Film; let film: Film = Film::from_title(String::from("Shrek"), String::from("21e783b3")).unwrap(); assert_eq!(film.get_title(), "Shrek");
In practice, unwrap()
should not be used as a FilmError
may be returned.
Methods
impl Film
[src]
pub fn from_title(title: String, key: String) -> Result<Film, FilmError>
[src]
Constructor for a Film object using a film's title.
Creates a Film object using the result of an OMDb query using the given
title. If no matching film is found, a FilmError
is returned instead.
pub fn from_id(id: String, key: String) -> Result<Film, FilmError>
[src]
Constructor for a Film object using a film's IMDB id.
Creates a Film object using the result of an OMDb query using the given
id. If no matching film is found, a FilmError
is returned instead.
pub fn search_for(title: String, key: String) -> Result<Vec<Film>, FilmError>
[src]
Returns a list of results found in a search for the given title.
Pulls the titles from a list of results to the query title
and returns
a vector of Film
objects containing each matching film in the OMDb.
pub fn get_title(&self) -> String
[src]
pub fn get_year(&self) -> String
[src]
pub fn get_runtime(&self) -> String
[src]
pub fn get_rated(&self) -> String
[src]
pub fn get_released(&self) -> String
[src]
pub fn get_genre(&self) -> String
[src]
pub fn get_director(&self) -> String
[src]
pub fn get_writer(&self) -> String
[src]
pub fn get_actors(&self) -> String
[src]
pub fn get_plot(&self) -> String
[src]
pub fn get_language(&self) -> String
[src]
Trait Implementations
impl Debug for Film
[src]
impl<'de> Deserialize<'de> for Film
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Film
[src]
Auto Trait Implementations
impl RefUnwindSafe for Film
impl Send for Film
impl Sync for Film
impl Unpin for Film
impl UnwindSafe for Film
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,