pub struct UpdateAnime { /* private fields */ }Implementations§
Source§impl UpdateAnime
impl UpdateAnime
Sourcepub fn from_malanimedata(mal_data: &MalAnimeData) -> Self
pub fn from_malanimedata(mal_data: &MalAnimeData) -> Self
Takes an existing MalAnimeData variable, and initializes data for an update
Sourcepub async fn update(&mut self) -> Result<ListStatus, Box<dyn Error>>
pub async fn update(&mut self) -> Result<ListStatus, Box<dyn Error>>
Calls the MyAnimeList API to update the user’s anime entry based on the fields the other methods implement.
The user must first be logged in, for the app to have received a Token from MyAnimList.
Example usage:
use mal_query::myanimelist::user::UpdateAnime;
async fn update_example() {
let status = UpdateAnime::new(33)
.update_score(10)
.expect("Score should be between 0-10")
.update()
.await
.unwrap(); // Assuming successful
assert_eq!(status.score, 10);
}Sourcepub fn update_status(&mut self, new_status: Status) -> &mut Self
pub fn update_status(&mut self, new_status: Status) -> &mut Self
Adds an update to the user’s status to the Update
Sourcepub fn update_is_rewatching(&mut self, new_is_rewatching: bool) -> &mut Self
pub fn update_is_rewatching(&mut self, new_is_rewatching: bool) -> &mut Self
Adds an update to the user’s is_rewatching to the Update
Sourcepub fn update_score(
&mut self,
new_score: u32,
) -> Result<&mut Self, Box<dyn Error>>
pub fn update_score( &mut self, new_score: u32, ) -> Result<&mut Self, Box<dyn Error>>
Adds an update to the user’s score to the Update
Sourcepub fn update_num_watched_episodes(
&mut self,
new_num_watched_episodes: u32,
) -> &mut Self
pub fn update_num_watched_episodes( &mut self, new_num_watched_episodes: u32, ) -> &mut Self
Adds an update to the user’s number of watched episodes to the Update
Sourcepub fn update_priority(
&mut self,
new_priority: u32,
) -> Result<&mut Self, Box<dyn Error>>
pub fn update_priority( &mut self, new_priority: u32, ) -> Result<&mut Self, Box<dyn Error>>
Adds an update to the user’s personal priority to the Update
Sourcepub fn update_num_times_rewatched(
&mut self,
new_num_times_rewatched: u32,
) -> &mut Self
pub fn update_num_times_rewatched( &mut self, new_num_times_rewatched: u32, ) -> &mut Self
Adds an update to the user’s number of times rewatched to the Update
Sourcepub fn update_rewatch_value(
&mut self,
new_rewatch_value: u32,
) -> Result<&mut Self, Box<dyn Error>>
pub fn update_rewatch_value( &mut self, new_rewatch_value: u32, ) -> Result<&mut Self, Box<dyn Error>>
Adds an update to the user’s rewatch value to the Update
Overrides the tags of the user’s anime entry
§WARNING:
This will change all tags into ONLY what the params are
Sourcepub fn update_comments(&mut self, new_comments: &str) -> &mut Self
pub fn update_comments(&mut self, new_comments: &str) -> &mut Self
Overrides the comment of the user’s anime entry