Crate musicbrainz_rs[−][src]
Expand description
MusicBrainz rust is a utility crate for the the MusicBrainz API. It strives to provide a simple and easy to use API to query the Musicbrainz database.
All query are performed via a builder pattern fashioned syntax on musicbrainz entities available
in the entity
module.
Example
The most simple usage would be to lookup an entity, knowing its Musicbrainz ID.
use musicbrainz_rs::entity::artist::Artist; use musicbrainz_rs::prelude::*; fn main() -> Result<(), Error> { let nirvana = Artist::fetch() .id("5b11f4ce-a62d-471e-81fc-a69a8278c7da") .execute(); assert_eq!(nirvana?.name, "Nirvana".to_string()); Ok(()) }
Note that you need to either directly to bring the Fetch
trait in scope or use the
prelude
module to make the fetch method accessible.
Modules
config | Configure the HTTP client global state |
entity | All Musicbrainz entities |
prelude | Brings trait and type needed to perform any API query in scope |
Structs
BrowseQuery | Direct lookup of all the entities directly linked to another entity |
FetchCoverartQuery | perform a lookup of an entity’s coverart when you have the MBID for that entity |
FetchQuery | perform a lookup of an entity when you have the MBID for that entity |
SearchQuery | Search requests provide a way to search for MusicBrainz entities based on different sorts of queries. |
Traits
Browse | Implemented by all browsable entities (see |
Fetch | Implemented by all fetchable entities (see |
FetchCoverart | Implemented by all fetchable coverart entities (see |
Path | Provide the entity HTTP api path, do not use this trait directly |
Search | Implemented by all searchable entities (see |
Type Definitions
Error | Type alias for reqwest::Error |