Struct librespot_core::spotify_id::SpotifyId [−][src]
pub struct SpotifyId {
pub id: u128,
pub audio_type: SpotifyAudioType,
}Fields
id: u128audio_type: SpotifyAudioTypeImplementations
impl SpotifyId[src]
impl SpotifyId[src]pub fn from_base16(src: &str) -> Result<SpotifyId, SpotifyIdError>[src]
Parses a base16 (hex) encoded Spotify ID into a SpotifyId.
src is expected to be 32 bytes long and encoded using valid characters.
pub fn from_base62(src: &str) -> Result<SpotifyId, SpotifyIdError>[src]
Parses a base62 encoded Spotify ID into a SpotifyId.
src is expected to be 22 bytes long and encoded using valid characters.
pub fn from_raw(src: &[u8]) -> Result<SpotifyId, SpotifyIdError>[src]
Creates a SpotifyId from a copy of SpotifyId::SIZE (16) bytes in big-endian order.
The resulting SpotifyId will default to a SpotifyAudioType::TRACK.
pub fn from_uri(src: &str) -> Result<SpotifyId, SpotifyIdError>[src]
Parses a Spotify URI into a SpotifyId.
uri is expected to be in the canonical form spotify:{type}:{id}, where {type}
can be arbitrary while {id} is a 22-character long, base62 encoded Spotify ID.
pub fn to_base16(&self) -> String[src]
Returns the SpotifyId as a base16 (hex) encoded, SpotifyId::SIZE_BASE62 (22)
character long String.
pub fn to_base62(&self) -> String[src]
Returns the SpotifyId as a canonically base62 encoded, SpotifyId::SIZE_BASE62 (22)
character long String.
pub fn to_raw(&self) -> [u8; 16][src]
Returns a copy of the SpotifyId as an array of SpotifyId::SIZE (16) bytes in
big-endian order.
pub fn to_uri(&self) -> String[src]
Returns the SpotifyId as a Spotify URI in the canonical form spotify:{type}:{id},
where {type} is an arbitrary string and {id} is a 22-character long, base62 encoded
Spotify ID.
If the SpotifyId has an associated type unrecognized by the library, {type} will
be encoded as unknown.
Trait Implementations
impl StructuralEq for SpotifyId[src]
impl StructuralEq for SpotifyId[src]impl StructuralPartialEq for SpotifyId[src]
impl StructuralPartialEq for SpotifyId[src]Auto Trait Implementations
impl RefUnwindSafe for SpotifyId
impl RefUnwindSafe for SpotifyIdimpl UnwindSafe for SpotifyId
impl UnwindSafe for SpotifyIdBlanket Implementations
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]pub fn equivalent(&self, key: &K) -> bool[src]
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,