pub struct EditResponse {
pub individual_results: Vec<SingleEditResponse>,
}Expand description
Response from a scrobble edit operation that may affect multiple album variations.
When editing a track that appears on multiple albums, this response contains the results of all individual edit operations performed.
§Examples
use lastfm_edit::{EditResponse, SingleEditResponse};
let response = EditResponse::from_results(vec![
SingleEditResponse {
success: true,
message: Some("Edit successful".to_string()),
album_info: Some("Album 1".to_string()),
}
]);
// Check if all edits succeeded
if response.all_successful() {
println!("All {} edits succeeded!", response.total_edits());
} else {
println!("Some edits failed: {}", response.summary_message());
}Fields§
§individual_results: Vec<SingleEditResponse>Results of individual edit operations
Implementations§
Source§impl EditResponse
impl EditResponse
Sourcepub fn single(
success: bool,
message: Option<String>,
album_info: Option<String>,
) -> Self
pub fn single( success: bool, message: Option<String>, album_info: Option<String>, ) -> Self
Create a new EditResponse from a single result.
Sourcepub fn from_results(results: Vec<SingleEditResponse>) -> Self
pub fn from_results(results: Vec<SingleEditResponse>) -> Self
Create a new EditResponse from multiple results.
Sourcepub fn all_successful(&self) -> bool
pub fn all_successful(&self) -> bool
Check if all individual edit operations were successful.
Sourcepub fn any_successful(&self) -> bool
pub fn any_successful(&self) -> bool
Check if any individual edit operations were successful.
Sourcepub fn total_edits(&self) -> usize
pub fn total_edits(&self) -> usize
Get the total number of edit operations performed.
Sourcepub fn successful_edits(&self) -> usize
pub fn successful_edits(&self) -> usize
Get the number of successful edit operations.
Sourcepub fn failed_edits(&self) -> usize
pub fn failed_edits(&self) -> usize
Get the number of failed edit operations.
Sourcepub fn summary_message(&self) -> String
pub fn summary_message(&self) -> String
Generate a summary message describing the overall result.
Sourcepub fn detailed_messages(&self) -> Vec<String>
pub fn detailed_messages(&self) -> Vec<String>
Get detailed messages from all edit operations.
Sourcepub fn is_single_edit(&self) -> bool
pub fn is_single_edit(&self) -> bool
Check if this response represents a single edit (for backward compatibility).
Trait Implementations§
Source§impl Clone for EditResponse
impl Clone for EditResponse
Source§fn clone(&self) -> EditResponse
fn clone(&self) -> EditResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more