[−][src]Struct sage_auth::validate::ValidateBuilder
ValidateBuilder
is used to generate a validate request
It can check if an access_token
is usable for authentication with a Minecraft server.
For more details, see [https://wiki.vg/Authentication]. For example:
let resp = ValidateBuilder::new() .access_token("ACCESS_TOKEN") .client_token(Uuid::new_v4()) .request() .await?;
Methods
impl<'a> ValidateBuilder<'a>
[src]
pub fn new() -> ValidateBuilder<'a>
[src]
pub fn client_token(&mut self, client_token: Uuid) -> &mut ValidateBuilder<'a>
[src]
Client token, the same as when you request access_token
.
pub fn access_token(
&mut self,
access_token: &'a str
) -> &mut ValidateBuilder<'a>
[src]
&mut self,
access_token: &'a str
) -> &mut ValidateBuilder<'a>
access_token
to invalidate.
pub fn server<T: IntoUrl>(
&mut self,
server: T
) -> Result<&mut ValidateBuilder<'a>>
[src]
&mut self,
server: T
) -> Result<&mut ValidateBuilder<'a>>
Set base url, default is https://authserver.mojang.com
.
pub fn endpoint(&mut self, endpoint: &'a str) -> &mut ValidateBuilder<'a>
[src]
set endpoint, default is /authenticate
.
pub async fn request<'_>(&'_ mut self) -> Result<()>
[src]
Make a request with the given parameters.
If success, it will return Ok(())
.
Trait Implementations
impl<'_> Default for ValidateBuilder<'_>
[src]
fn default() -> ValidateBuilder<'static>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for ValidateBuilder<'a>
impl<'a> Send for ValidateBuilder<'a>
impl<'a> Sync for ValidateBuilder<'a>
impl<'a> Unpin for ValidateBuilder<'a>
impl<'a> UnwindSafe for ValidateBuilder<'a>
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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,