azalea_client/account/
offline.rs1use uuid::Uuid;
2
3use crate::account::{Account, AccountTrait};
4
5#[derive(Debug)]
11pub struct OfflineAccount {
12 username: String,
13}
14impl AccountTrait for OfflineAccount {
15 fn username(&self) -> &str {
16 &self.username
17 }
18 fn uuid(&self) -> Uuid {
19 azalea_crypto::offline::generate_uuid(&self.username)
20 }
21 fn access_token(&self) -> Option<String> {
22 None
23 }
24}
25
26impl Account {
27 pub fn offline(username: &str) -> Self {
32 OfflineAccount {
33 username: username.to_owned(),
34 }
35 .into()
36 }
37}