pub struct Credentials {
pub username: Option<String>,
pub auth_type: AuthenticationType,
pub auth_data: Vec<u8>,
}
Expand description
The credentials are used to log into the Spotify API.
Fields§
§username: Option<String>
§auth_type: AuthenticationType
§auth_data: Vec<u8>
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn with_password(
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_password( username: impl Into<String>, password: impl Into<String>, ) -> Self
Intialize these credentials from a username and a password.
§Example
use librespot_core::authentication::Credentials;
let creds = Credentials::with_password("my account", "my password");
pub fn with_access_token(token: impl Into<String>) -> Self
pub fn with_blob( username: impl Into<String>, encrypted_blob: impl AsRef<[u8]>, device_id: impl AsRef<[u8]>, ) -> Result<Self, Error>
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Credentials
impl Debug for Credentials
Source§impl Default for Credentials
impl Default for Credentials
Source§fn default() -> Credentials
fn default() -> Credentials
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Credentials
impl<'de> Deserialize<'de> for Credentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Credentials
impl PartialEq for Credentials
Source§impl Serialize for Credentials
impl Serialize for Credentials
impl StructuralPartialEq for Credentials
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
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