pub struct DeviceFlow { /* private fields */ }
Implementations§
Source§impl DeviceFlow
impl DeviceFlow
Sourcepub fn new(client_id: String, host: String, scopes: String) -> Self
pub fn new(client_id: String, host: String, scopes: String) -> Self
Examples found in repository?
examples/simple.rs (line 10)
4async fn main() {
5 let client_id = std::env::var("GITHUB_CLIENT_ID").unwrap();
6 let retrieve_refresh_token =
7 || std::env::var("GITHUB_REFRESH_TOKEN").map_err(|_| DeviceFlowError::RefreshTokenNotFound);
8 let host = "github.com".to_owned();
9 let scopes = "read:user".to_owned();
10 let flow = DeviceFlow::new(client_id, host, scopes);
11 let cred = flow
12 .refresh_or_authorize(retrieve_refresh_token)
13 .await
14 .unwrap();
15 dbg!(cred);
16}
Examples found in repository?
examples/simple.rs (line 12)
4async fn main() {
5 let client_id = std::env::var("GITHUB_CLIENT_ID").unwrap();
6 let retrieve_refresh_token =
7 || std::env::var("GITHUB_REFRESH_TOKEN").map_err(|_| DeviceFlowError::RefreshTokenNotFound);
8 let host = "github.com".to_owned();
9 let scopes = "read:user".to_owned();
10 let flow = DeviceFlow::new(client_id, host, scopes);
11 let cred = flow
12 .refresh_or_authorize(retrieve_refresh_token)
13 .await
14 .unwrap();
15 dbg!(cred);
16}
Trait Implementations§
Source§impl Clone for DeviceFlow
impl Clone for DeviceFlow
Source§fn clone(&self) -> DeviceFlow
fn clone(&self) -> DeviceFlow
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 moreAuto Trait Implementations§
impl Freeze for DeviceFlow
impl RefUnwindSafe for DeviceFlow
impl Send for DeviceFlow
impl Sync for DeviceFlow
impl Unpin for DeviceFlow
impl UnwindSafe for DeviceFlow
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