Struct sunk::song::Song

source ·
pub struct Song {
    pub id: u64,
    pub title: String,
    pub album: Option<String>,
    pub artist: Option<String>,
    pub track: Option<u64>,
    pub year: Option<u64>,
    pub genre: Option<String>,
    pub size: u64,
    pub duration: Option<u64>,
    /* private fields */
}
Expand description

A work of music contained on a Subsonic server.

Fields

id: u64

Unique identifier for the song.

title: String

Title of the song. Prefers the song’s ID3 tags, but will fall back to the file name.

album: Option<String>

Album the song belongs to. Reads from the song’s ID3 tags.

artist: Option<String>

Credited artist for the song. Reads from the song’s ID3 tags.

track: Option<u64>

Position of the song in the album.

year: Option<u64>

Year the song was released.

genre: Option<String>

Genre of the song.

size: u64

File size of the song, in bytes.

duration: Option<u64>

Duration of the song, in seconds.

Implementations

Returns a single song from the Subsonic server.

Errors

Aside from other errors the Client may cause, the server will return an error if there is no song matching the provided ID.

Returns a number of random songs similar to this one.

last.fm suggests a number of similar songs to the one the method is called on. Optionally takes a count to specify the maximum number of results to return.

Returns a number of random songs. Optionally accepts a maximum number of results to return.

Some parts of the query can be modified. Use random_with to be able to set these optional fields.

Creates a new builder to request a set of random songs.

See the struct level documentation for more information on how to use the builder.

Lists all the songs in a provided genre. Supports paging through the result.

See the struct level documentation about paging for more.

Creates an HLS (HTTP Live Streaming) playlist used for streaming video or audio. HLS is a streaming protocol implemented by Apple and works by breaking the overall stream into a sequence of small HTTP-based file downloads. It’s supported by iOS and newer versions of Android.

Returns an M3U8 playlist on success (content type “application/vnd.apple.mpegurl”).

The method also supports adaptive streaming; when supplied with multiple bit rates, the server will create a variable playlist, suitable for adaptive bitrate streaming. The playlist will support streaming at all the specified bitrates. The bit_rate parameter can be omitted (with an empty array) to disable adaptive streaming, or given a single value to force streaming at that bit rate.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Returns whether or not the media has an associated cover.
Returns the cover ID associated with the media, if any. Read more
Returns the raw bytes of the cover art of the media. Read more
Returns the URL pointing to the cover art of the media. Read more
Returns the raw bytes of the media. Read more
Returns a constructed URL for streaming. Read more
Returns the raw bytes of the media. Read more
Returns a constructed URL for downloading the song.
Returns the default encoding of the media. Read more
Sets the maximum bitrate the media will use when streaming. Read more
Sets the transcoding format the media will use when streaming. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.