Skip to main content

Crate moosicbox_music_models

Crate moosicbox_music_models 

Source
Expand description

Core data models for music metadata and playback.

This crate provides the fundamental data structures for representing music entities (artists, albums, tracks) and their metadata across different API sources. It supports both local library content and external music service APIs.

§Main Types

  • Artist - Represents a music artist with metadata
  • Album - Represents a music album with versions and quality information
  • Track - Represents a music track with audio properties and metadata
  • ApiSource - Identifies the source of music content (Library, Tidal, Qobuz, etc.)
  • id::Id - Flexible identifier supporting both numeric and string IDs

§Features

  • api - Enables API-specific model types for serialization
  • db - Enables database integration and query support
  • Audio format support: aac, flac, mp3, opus

Modules§

api
API-specific model types for serialization and network transfer.
db
Database integration for model types.
id
Flexible ID types supporting both numeric and string identifiers.

Structs§

Album
Represents a music album with its metadata and available versions.
AlbumVersionQuality
Represents the audio quality characteristics of a specific album version.
ApiSource
An identifier for a music API source (e.g., “Library”, “Tidal”, “Qobuz”).
ApiSources
A collection of API source-ID pairs for tracking the same entity across multiple sources.
Artist
Represents a music artist.
FromStringApiSourceError
Error returned when attempting to parse an unregistered API source.
PlaybackQuality
Playback quality settings for audio.
Track
Represents a music track with its metadata and audio properties.
TrackSize
Represents the size of a track in a specific format.
TryFromStringTrackApiSourceError
Error returned when attempting to parse an invalid track API source string.

Enums§

AlbumSort
Sort order for album listings.
AlbumSource
The API source for an album, either local or from an external API.
AlbumType
The type/category of an album.
ArtistSort
Sort order for artist listings.
AudioFormat
Audio format for tracks and albums.
TrackApiSource
The API source for a specific track, either local or from an external API.

Statics§

API_SOURCES
Global registry of all registered API sources.
LIBRARY_API_SOURCE
The built-in “Library” API source representing locally stored music.

Functions§

from_extension_to_audio_format
Converts a file extension to an audio format.