[−][src]Struct youtube_api::YoutubeApi
Implementations
impl YoutubeApi
[src]
pub fn new_with_oauth<S: Into<String>>(
api_key: S,
client_id: String,
client_secret: String,
redirect_uri: Option<&str>
) -> Result<Self, Error>
[src]
api_key: S,
client_id: String,
client_secret: String,
redirect_uri: Option<&str>
) -> Result<Self, Error>
pub async fn login<'_, H>(&'_ self, handler: H) -> Result<(), Error> where
H: Fn(String) -> String,
[src]
H: Fn(String) -> String,
Perform an OAuth Login
Available handlers:
Example
use youtube::{YoutubeApi, auth::stdio_login}; #[tokio::main] async fn main() { let api = YoutubeApi::new_with_oauth("", String::new(), String::new(), None).unwrap(); api.login(stdio_login).await.unwrap(); }
pub fn get_oauth_url(&self) -> Result<(String, String), Error>
[src]
pub async fn request_token<'_>(
&'_ mut self,
code: String,
verifier: String
) -> Result<(), Error>
[src]
&'_ mut self,
code: String,
verifier: String
) -> Result<(), Error>
pub fn has_token(&self) -> bool
[src]
pub async fn store_token<'_>(&'_ self) -> Result<(), Error>
[src]
Stores the auth and refresh token in a .google-auth.json
file for login without user input.
pub async fn load_token<'_>(&'_ self) -> Result<(), Error>
[src]
Stores the auth and refresh token from a .google-auth.json
file for login without user input.
impl YoutubeApi
[src]
pub async fn get_video_info<'_>(id: &'_ str) -> Result<VideoMetadata, Error>
[src]
pub fn new<S: Into<String>>(api_key: S) -> Self
[src]
pub async fn search<'_>(
&'_ self,
search_request: SearchRequestBuilder
) -> Result<SearchResponse, Error>
[src]
&'_ self,
search_request: SearchRequestBuilder
) -> Result<SearchResponse, Error>
pub async fn list_playlists<'_>(
&'_ self,
request: ListPlaylistsRequestBuilder
) -> Result<ListPlaylistsResponse, Error>
[src]
&'_ self,
request: ListPlaylistsRequestBuilder
) -> Result<ListPlaylistsResponse, Error>
pub async fn list_playlist_items<'_>(
&'_ self,
request: ListPlaylistItemsRequestBuilder
) -> Result<ListPlaylistItemsResponse, Error>
[src]
&'_ self,
request: ListPlaylistItemsRequestBuilder
) -> Result<ListPlaylistItemsResponse, Error>
Trait Implementations
impl Clone for YoutubeApi
[src]
fn clone(&self) -> YoutubeApi
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for YoutubeApi
[src]
Auto Trait Implementations
impl !RefUnwindSafe for YoutubeApi
impl Send for YoutubeApi
impl Sync for YoutubeApi
impl Unpin for YoutubeApi
impl !UnwindSafe for YoutubeApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,