[−][src]Struct sage_auth::session::Session
A Minecraft authentication session with access_token
and client_token
saved.
Methods
impl Session
[src]
pub async fn from_token<S: Into<String>>(
access_token: S,
client_token: Uuid
) -> Result<Session>
[src]
access_token: S,
client_token: Uuid
) -> Result<Session>
Use saved access_token
to create a session.
let session = Session::from_token("ACCESS_TOKEN", Uuid::new_v4()).await?;
pub async fn login<'_, '_>(
username: &'_ str,
password: &'_ str
) -> Result<Session>
[src]
username: &'_ str,
password: &'_ str
) -> Result<Session>
Login to create a session.
let session = Session::login("USERNAME", "PASSWORD").await?;
pub async fn join_server<'_, '_>(
&'_ self,
server_id_hash: &'_ str
) -> Result<()>
[src]
&'_ self,
server_id_hash: &'_ str
) -> Result<()>
Post a join message to Mojang session server.
Note: server_id_hash
is generated by a special hash function,
which can be found in wiki.vg
let session = Session::login("USERNAME", "PASSWORD").await?; let server_hash = "..."; session.join_server(server_hash).await?;
pub fn access_token(&self) -> &str
[src]
Get access_token
pub fn client_token(&self) -> Uuid
[src]
Get client_token
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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>,