Struct mal::MAL
[−]
[src]
pub struct MAL { pub username: String, pub password: String, pub client: Client, }
Used to interact with the MyAnimeList API with authorization being handled automatically.
Fields
username: String
The user's name on MyAnimeList.
password: String
The user's password on MyAnimeList.
client: Client
The client used to send requests to the API.
Methods
impl MAL
[src]
fn new<S: Into<String>>(username: S, password: S) -> MAL
[src]
Creates a new instance of the MAL struct for interacting with the MyAnimeList API.
If you only need to retrieve the user's anime list, then you do not need to provide a valid password.
fn with_client<S: Into<String>>(username: S, password: S, client: Client) -> MAL
[src]
Creates a new instance of the MAL struct for interacting with the MyAnimeList API.
If you only need to retrieve the user's anime list, then you do not need to provide a valid password.
fn search(&self, name: &str) -> Result<Vec<SeriesInfo>, Error>
[src]
Searches MyAnimeList for an anime and returns all found results.
Example
use mal::MAL; let mal = MAL::new("username", "password"); let found = mal.search("Cowboy Bebop").unwrap(); assert!(found.len() > 0);
fn verify_credentials(&self) -> Result<bool, Error>
[src]
Returns true if the provided account credentials are correct.
Examples
use mal::MAL; // Create a new MAL instance let mal = MAL::new("username", "password"); // Verify that the username and password are valid let valid = mal.verify_credentials().unwrap(); assert_eq!(valid, false);
fn anime_list(&self) -> AnimeList
[src]
Returns a new AnimeList instance to allow operations on the user's list.