Struct sunk::NowPlaying

source ·
pub struct NowPlaying {
    pub user: String,
    pub minutes_ago: usize,
    pub player_id: usize,
    /* private fields */
}
Expand description

Information about currently playing media.

Due to the “now playing” information possibly containing both audio and video, compromises are made. NowPlaying only stores the ID, title, and content type of the media. This is most of the information afforded through the web interface. For more detailed information, song_info() or video_info() gives the full Song or Video struct, though requires another web request.

Fields

user: String

The user streaming the current media.

minutes_ago: usize

How long ago the user sent an update to the server.

player_id: usize

The ID of the player.

Implementations

Fetches information about the currently playing song.

Errors

Aside from the inherent errors from the Client, the method will error if the NowPlaying is not a song.

Fetches information about the currently playing video.

Errors

Aside from the inherent errors from the Client, the method will error if the NowPlaying is not a video.

Returns true if the currently playing media is a song.

Returns true if the currently playing media is a video.

Trait Implementations

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. 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 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.