Struct musicbrainz_rs::SearchQuery
source · pub struct SearchQuery<T>(_);
Expand description
Search requests provide a way to search for MusicBrainz entities based on different sorts of queries.
Search
The MusicBrainz API search requests provide a way to search for MusicBrainz entities based on different sorts of queries.
Example
let query = ArtistSearchQuery::query_builder()
.artist("Miles Davis")
.and()
.country("US")
.build();
let query_result = Artist::search(query).execute().await?;
let query_result: Vec<String> = query_result
.entities
.iter()
.map(|artist| artist.name.clone())
.collect();
assert!(query_result.contains(&"Miles Davis".to_string()));
assert!(query_result.contains(&"Miles Davis Quintet".to_string()));
let query = ArtistSearchQuery::query_builder()
.artist("Miles Davis")
.and()
.country("US")
.build();
let query_result = Artist::search(query).execute()?;
let query_result: Vec<String> = query_result
.entities
.iter()
.map(|artist| artist.name.clone())
.collect();
assert!(query_result.contains(&"Miles Davis".to_string()));
assert!(query_result.contains(&"Miles Davis Quintet".to_string()));
Implementations§
source§impl SearchQuery<Area>
impl SearchQuery<Area>
pub fn with_area_relations(&mut self) -> &mut Self
pub fn with_event_relations(&mut self) -> &mut Self
pub fn with_recording_relations(&mut self) -> &mut Self
pub fn with_release_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_work_relations(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Artist>
impl SearchQuery<Artist>
pub fn with_recordings(&mut self) -> &mut Self
pub fn with_releases(&mut self) -> &mut Self
pub fn with_releases_and_discids(&mut self) -> &mut Self
pub fn with_release_groups(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_works(&mut self) -> &mut Self
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_event_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_work_relations(&mut self) -> &mut Self
pub fn with_recording_relations(&mut self) -> &mut Self
pub fn with_release_relations(&mut self) -> &mut Self
pub fn with_series_relations(&mut self) -> &mut Self
pub fn with_rating(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Event>
impl SearchQuery<Event>
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_place_relations(&mut self) -> &mut Self
pub fn with_series_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_ratings(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Instrument>
impl SearchQuery<Instrument>
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Label>
impl SearchQuery<Label>
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_label_relations(&mut self) -> &mut Self
pub fn with_recording_relations(&mut self) -> &mut Self
pub fn with_release_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_releases(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_ratings(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Place>
impl SearchQuery<Place>
pub fn with_event_relations(&mut self) -> &mut Self
pub fn with_recording_relations(&mut self) -> &mut Self
pub fn with_release_relations(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Recording>
impl SearchQuery<Recording>
pub fn with_artists(&mut self) -> &mut Self
pub fn with_releases(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_ratings(&mut self) -> &mut Self
pub fn with_isrcs(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_work_relations(&mut self) -> &mut Self
pub fn with_work_level_relations(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Release>
impl SearchQuery<Release>
pub fn with_artists(&mut self) -> &mut Self
pub fn with_labels(&mut self) -> &mut Self
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_work_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_work_level_relations(&mut self) -> &mut Self
pub fn with_recording_level_relations(&mut self) -> &mut Self
pub fn with_recordings(&mut self) -> &mut Self
pub fn with_release_groups(&mut self) -> &mut Self
pub fn with_ratings(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
pub fn with_artist_credits(&mut self) -> &mut Self
source§impl SearchQuery<ReleaseGroup>
impl SearchQuery<ReleaseGroup>
pub fn with_release_group_relations(&mut self) -> &mut Self
pub fn with_series_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_artists(&mut self) -> &mut Self
pub fn with_releases(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_ratings(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Series>
impl SearchQuery<Series>
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_release_group_relations(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl SearchQuery<Url>
impl SearchQuery<Url>
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
source§impl SearchQuery<Work>
impl SearchQuery<Work>
pub fn with_artist_relations(&mut self) -> &mut Self
pub fn with_label_relations(&mut self) -> &mut Self
pub fn with_recording_relations(&mut self) -> &mut Self
pub fn with_url_relations(&mut self) -> &mut Self
pub fn with_work_relations(&mut self) -> &mut Self
pub fn with_ratings(&mut self) -> &mut Self
pub fn with_aliases(&mut self) -> &mut Self
pub fn with_genres(&mut self) -> &mut Self
pub fn with_annotations(&mut self) -> &mut Self
source§impl<'a, T> SearchQuery<T>where
T: Search<'a> + Clone,
impl<'a, T> SearchQuery<T>where
T: Search<'a> + Clone,
pub async fn execute(&mut self) -> Result<SearchResult<T>, Error>where
T: Search<'a> + DeserializeOwned + Searchable,
Trait Implementations§
source§impl<T: Clone> Clone for SearchQuery<T>
impl<T: Clone> Clone for SearchQuery<T>
source§fn clone(&self) -> SearchQuery<T>
fn clone(&self) -> SearchQuery<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more