pub struct SearchBuilder { /* private fields */ }Implementations§
Source§impl SearchBuilder
impl SearchBuilder
Sourcepub fn new(name: &str, limit: u32) -> Self
pub fn new(name: &str, limit: u32) -> Self
Takes an anime name and limiter, and initializes a search entry retriever for the corresponding anime
Sourcepub async fn run(&self) -> Result<MalAnimeSearch, Box<dyn Error>>
pub async fn run(&self) -> Result<MalAnimeSearch, Box<dyn Error>>
Calls the MyAnimeList API to recieve anime created by the builder, based on the name, a limiter,
and fields added from the other methods.
The user does not need to be logged in, aside from using the .add_my_list_status()
to the result.
This method returns a Result, containing either the data in a MalAnimeSearch, or an error.
§Example usage:
use mal_query::myanimelist::builders::{SearchBuilder, AddFields};
async fn search_builder_example() {
let berserk = SearchBuilder::new("berserk", 1)
.add_start_date()
.add_rank()
.run()
.await;
match berserk {
Err(_e) => assert!(false),
Ok(data_vec) => {
let data = data_vec.get(0).unwrap();
assert!(
data
.title
.to_lowercase()
.contains("berserk")
);
assert_eq!(data.id, 33);
}
}
}Trait Implementations§
Source§impl AddFields for SearchBuilder
impl AddFields for SearchBuilder
Source§fn add_title(&mut self) -> &mut Self
fn add_title(&mut self) -> &mut Self
Adds the option of a title to be given to the final result
Source§fn add_main_picture(&mut self) -> &mut Self
fn add_main_picture(&mut self) -> &mut Self
Adds the option of a Main Picture to be given to the final result
Source§fn add_alt_titles(&mut self) -> &mut Self
fn add_alt_titles(&mut self) -> &mut Self
Adds the option of Alternate Titles to be given to the final result
Source§fn add_start_date(&mut self) -> &mut Self
fn add_start_date(&mut self) -> &mut Self
Adds the option of a Start Date to be given to the final result
Source§fn add_end_date(&mut self) -> &mut Self
fn add_end_date(&mut self) -> &mut Self
Adds the option of an End Date to be given to the final result
Source§fn add_synopsis(&mut self) -> &mut Self
fn add_synopsis(&mut self) -> &mut Self
Adds the option of a Synopsis to be given to the final result
Source§fn add_popularity(&mut self) -> &mut Self
fn add_popularity(&mut self) -> &mut Self
Adds the option of Popularity to be given to the final result
Source§fn add_num_list_users(&mut self) -> &mut Self
fn add_num_list_users(&mut self) -> &mut Self
Adds the option of Num. List Users to be given to the final result
Source§fn add_num_scoring_users(&mut self) -> &mut Self
fn add_num_scoring_users(&mut self) -> &mut Self
Adds the option of Num. Scoring Users to be given to the final result
Source§fn add_nsfw(&mut self) -> &mut Self
fn add_nsfw(&mut self) -> &mut Self
Adds the option of NSFW rating to be given to the final result
Source§fn add_created_at(&mut self) -> &mut Self
fn add_created_at(&mut self) -> &mut Self
Adds the option of a Created Date to be given to the final result
Source§fn add_updated_at(&mut self) -> &mut Self
fn add_updated_at(&mut self) -> &mut Self
Adds the option of an Updated Date to be given to the final result
Source§fn add_media_type(&mut self) -> &mut Self
fn add_media_type(&mut self) -> &mut Self
Adds the option of a Media Type to be given to the final result
Source§fn add_status(&mut self) -> &mut Self
fn add_status(&mut self) -> &mut Self
Adds the option of the Airing Status to be given to the final result
Source§fn add_genres(&mut self) -> &mut Self
fn add_genres(&mut self) -> &mut Self
Adds the option of Genres to be given to the final result
Source§fn add_my_list_status(&mut self) -> &mut Self
fn add_my_list_status(&mut self) -> &mut Self
Adds the option of your List Status to be given to the final result
Source§fn add_start_season(&mut self) -> &mut Self
fn add_start_season(&mut self) -> &mut Self
Adds the option of Start Season data to be given to the final result
Source§fn add_num_episodes(&mut self) -> &mut Self
fn add_num_episodes(&mut self) -> &mut Self
Adds the option of an Episode Count to be given to the final result
Source§fn add_broadcast(&mut self) -> &mut Self
fn add_broadcast(&mut self) -> &mut Self
Adds the option of Broadcast data to be given to the final result
Source§fn add_source(&mut self) -> &mut Self
fn add_source(&mut self) -> &mut Self
Adds the option of Source data to be given to the final result
Source§fn add_average_episode_duration(&mut self) -> &mut Self
fn add_average_episode_duration(&mut self) -> &mut Self
Adds the option of an Average Episode Duration to be given to the final result
Source§fn add_rating(&mut self) -> &mut Self
fn add_rating(&mut self) -> &mut Self
Adds the option of a Rating type to be given to the final result
Source§fn add_pictures(&mut self) -> &mut Self
fn add_pictures(&mut self) -> &mut Self
Adds the option of MyAnimeList’s Pictures to be given to the final result
Source§fn add_background(&mut self) -> &mut Self
fn add_background(&mut self) -> &mut Self
Adds the option of the show’s Background to be given to the final result
Adds the option of Related Anime to be given to the final result
Adds the option of Related Manga to be given to the final result
Source§fn add_recommendations(&mut self) -> &mut Self
fn add_recommendations(&mut self) -> &mut Self
Adds the option of Recommendations to be given to the final result
Source§fn add_studios(&mut self) -> &mut Self
fn add_studios(&mut self) -> &mut Self
Adds the option of Studio data to be given to the final result
Source§fn add_statistics(&mut self) -> &mut Self
fn add_statistics(&mut self) -> &mut Self
Adds the option of MyAnimeList Statistics to be given to the final result