[][src]Struct sage_auth::auth::AuthenticateBuilder

pub struct AuthenticateBuilder<'a> { /* fields omitted */ }

AuthenticateBuilder is used to generate a authenticate request

For example:

let resp = AuthenticateBuilder::new()
    .username("USERNAME")
    .password("PASSWORD")
    .request()
    .await?;

Methods

impl<'a> AuthenticateBuilder<'a>[src]

pub fn new() -> AuthenticateBuilder<'a>[src]

pub fn username(&mut self, username: &'a str) -> &mut AuthenticateBuilder<'a>[src]

Set username

pub fn password(&mut self, password: &'a str) -> &mut AuthenticateBuilder<'a>[src]

Set password

pub fn client_token(
    &mut self,
    client_token: Uuid
) -> &mut AuthenticateBuilder<'a>
[src]

Specify a client token. If is not provided, it will be generated when making a request.

pub fn request_user(&mut self) -> &mut AuthenticateBuilder<'a>[src]

Set to request user profile. If set, AuthenticateResponse will contain the user profile.

pub fn agent_name(
    &mut self,
    agent_name: &'a str
) -> &mut AuthenticateBuilder<'a>
[src]

Set agent name, default is Minecraft

pub fn agent_version(
    &mut self,
    agent_version: i32
) -> &mut AuthenticateBuilder<'a>
[src]

Set agent version, default is 1

pub fn server<T: IntoUrl>(
    &mut self,
    server: T
) -> Result<&mut AuthenticateBuilder<'a>>
[src]

Set base url, default is https://authserver.mojang.com.

pub fn endpoint(&mut self, endpoint: &'a str) -> &mut AuthenticateBuilder<'a>[src]

set endpoint, default is /authenticate.

pub async fn request<'_>(&'_ mut self) -> Result<AuthenticateResponse>[src]

Make a request with the given parameters.

Trait Implementations

impl<'_> Default for AuthenticateBuilder<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for AuthenticateBuilder<'a>

impl<'a> Send for AuthenticateBuilder<'a>

impl<'a> Sync for AuthenticateBuilder<'a>

impl<'a> Unpin for AuthenticateBuilder<'a>

impl<'a> UnwindSafe for AuthenticateBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,