pub struct GetCurrentAuthorizationInformation<'a> { /* private fields */ }
Expand description
Retrieve information about the current OAuth2 authorization.
Returns the application’s, authorization’s, and if applicable the user’s details.
Refer to Discord Docs/Get Current Authorization Information.
§Examples
use std::env;
use twilight_http::Client;
let bearer_token = env::var("BEARER_TOKEN")?;
let client = Client::new(bearer_token);
let response = client.current_authorization().await?;
let authorization = response.model().await?;
println!("Application: {}", authorization.application.name);
if let Some(user) = authorization.user {
println!("User: {}", user.name);
}
Trait Implementations§
source§impl IntoFuture for GetCurrentAuthorizationInformation<'_>
impl IntoFuture for GetCurrentAuthorizationInformation<'_>
source§type Output = Result<Response<CurrentAuthorizationInformation>, Error>
type Output = Result<Response<CurrentAuthorizationInformation>, Error>
The output that the future will produce on completion.
source§type IntoFuture = ResponseFuture<CurrentAuthorizationInformation>
type IntoFuture = ResponseFuture<CurrentAuthorizationInformation>
Which kind of future are we turning this into?
source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
source§impl TryIntoRequest for GetCurrentAuthorizationInformation<'_>
impl TryIntoRequest for GetCurrentAuthorizationInformation<'_>
Auto Trait Implementations§
impl<'a> Freeze for GetCurrentAuthorizationInformation<'a>
impl<'a> !RefUnwindSafe for GetCurrentAuthorizationInformation<'a>
impl<'a> Send for GetCurrentAuthorizationInformation<'a>
impl<'a> Sync for GetCurrentAuthorizationInformation<'a>
impl<'a> Unpin for GetCurrentAuthorizationInformation<'a>
impl<'a> !UnwindSafe for GetCurrentAuthorizationInformation<'a>
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