pub struct Account {
pub username: String,
pub access_token: Option<String>,
pub uuid: Option<Uuid>,
}
Expand description
Something that can join Minecraft servers.
To join a server using this account, use crate::Client::join
.
Fields
username: String
The Minecraft username of the account.
access_token: Option<String>
The access token for authentication. You can obtain one of these manually from azalea-auth.
uuid: Option<Uuid>
Only required for online-mode accounts.
Implementations
sourceimpl Account
impl Account
sourcepub fn offline(username: &str) -> Account
pub fn offline(username: &str) -> Account
An offline account does not authenticate with Microsoft’s servers, and as such can only join offline mode servers. This is useful for testing in LAN worlds.
sourcepub async fn microsoft(
email: &str
) -> impl Future<Output = Result<Account, AuthError>>
pub async fn microsoft(
email: &str
) -> impl Future<Output = Result<Account, AuthError>>
This will create an online-mode account by authenticating with Microsoft’s servers. Note that the email given is actually only used as a key for the cache, but it’s recommended to use the real email to avoid confusion.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more