pub struct YTMusicClientBuilder { /* private fields */ }Expand description
Builder for constructing a YTMusicClient.
Implementations§
Source§impl YTMusicClientBuilder
impl YTMusicClientBuilder
Sourcepub fn with_browser_auth(self, auth: BrowserAuth) -> Self
pub fn with_browser_auth(self, auth: BrowserAuth) -> Self
Set browser authentication.
Sourcepub fn with_oauth_token(self, token: OAuthToken) -> Self
pub fn with_oauth_token(self, token: OAuthToken) -> Self
Set OAuth authentication using an existing token.
To enable automatic refresh, use [with_oauth_token_and_credentials].
Sourcepub fn with_oauth_token_and_credentials(
self,
token: OAuthToken,
credentials: OAuthCredentials,
) -> Self
pub fn with_oauth_token_and_credentials( self, token: OAuthToken, credentials: OAuthCredentials, ) -> Self
Set OAuth authentication with refresh support.
Sourcepub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
Set the language for responses.
Default is “en” (English).
Sourcepub fn with_location(self, location: impl Into<String>) -> Self
pub fn with_location(self, location: impl Into<String>) -> Self
Set the location for results.
Use ISO 3166-1 alpha-2 country codes (e.g., “US”, “GB”, “DE”).
Sourcepub fn with_user(self, user: impl Into<String>) -> Self
pub fn with_user(self, user: impl Into<String>) -> Self
Set a user ID for brand account requests.
Sourcepub fn build(self) -> Result<YTMusicClient>
pub fn build(self) -> Result<YTMusicClient>
Build the client.
Auto Trait Implementations§
impl !Freeze for YTMusicClientBuilder
impl RefUnwindSafe for YTMusicClientBuilder
impl Send for YTMusicClientBuilder
impl Sync for YTMusicClientBuilder
impl Unpin for YTMusicClientBuilder
impl UnwindSafe for YTMusicClientBuilder
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