pub struct SpotifyId {
pub id: u128,
}Fields§
§id: u128Implementations§
Source§impl SpotifyId
impl SpotifyId
Sourcepub fn from_base16(src: &str) -> SpotifyIdResult
pub fn from_base16(src: &str) -> SpotifyIdResult
Parses a base16 (hex) encoded Spotify ID into a SpotifyId.
src is expected to be 32 bytes long and encoded using valid characters.
Sourcepub fn from_base62(src: &str) -> SpotifyIdResult
pub fn from_base62(src: &str) -> SpotifyIdResult
Parses a base62 encoded Spotify ID into a u128.
src is expected to be 22 bytes long and encoded using valid characters.
Sourcepub fn from_raw(src: &[u8]) -> SpotifyIdResult
pub fn from_raw(src: &[u8]) -> SpotifyIdResult
Creates a u128 from a copy of SpotifyId::SIZE (16) bytes in big-endian order.
The resulting SpotifyId will default to a SpotifyItemType::Unknown.
Sourcepub fn to_base16(&self) -> Result<String, Error>
pub fn to_base16(&self) -> Result<String, Error>
Returns the SpotifyId as a base16 (hex) encoded, SpotifyId::SIZE_BASE16 (32)
character long String.
Trait Implementations§
Source§impl TryFrom<&SpotifyUri> for SpotifyId
impl TryFrom<&SpotifyUri> for SpotifyId
impl Copy for SpotifyId
impl Eq for SpotifyId
impl StructuralPartialEq for SpotifyId
Auto Trait Implementations§
impl Freeze for SpotifyId
impl RefUnwindSafe for SpotifyId
impl Send for SpotifyId
impl Sync for SpotifyId
impl Unpin for SpotifyId
impl UnwindSafe for SpotifyId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.