Enum imdb::Language
[−]
[src]
pub enum Language { en_US, en_GB, it_IT, fr_FR, de_DE, da_DK, }
Options for IMDb language support via Accept-Language
IMDb shows content in various languages based on Accept-Language
header present in HTTP request. This library supports fetching
content in different languages.
This list is just a start. If there are other languages in which IMDb shows content but no options are provided here, open an issue.
Example
use imdb::{IMDb, Language}; let imdb = IMDb::new(); imdb.accept_language(Languages::fr_FR) top_250 = imdb.top250_movies().unwrap(); assert_eq!("Les évadés", top_250[0].title); assert_eq!("Le parrain", top_250[1].title);
Why Typed?
Or why not stringly-typed?
Under the hood, this library uses hyper which is highly opiniated
about how headers
should be presented.
Hyper has the opinion that Headers should be strongly-typed, because that's why we're using Rust in the first place. To set or get any header, an object must implement the Header trait from this module.
In the same spirit, this library restricts string based options.
References
Variants
en_US
American English
en_GB
British English
it_IT
Italian (Italy)
fr_FR
French (France)
de_DE
German (German)
da_DK
Danish (Denmark)
Methods
impl Language
[src]
fn accept_language_header(&self) -> AcceptLanguage
[src]
Returns Accept-Language Header of Language Option
fn description(&self) -> &'static str
[src]
Returns Description of Language Option