[][src]Function omdbrs::search_by_id

pub fn search_by_id(id: String) -> Result<Film, Error>

Searches for and returns a film in the OMDb.

Sends a request to OMDb for a film with the id id and returns a Film object populated with the returned information. Does no input validation, formatting, or case-switching, so can be temperamental. Returns a reqwest::Error upon failure.

Examples

To search for the film Shrek:

use omdbrs;

let shrek: omdbrs::Film = omdbrs::search_by_id(String::from("tt0126029"))
  .unwrap();

assert_eq!(shrek.Title, "Shrek");