pub struct OfflineAuth { /* private fields */ }Expand description
Offline authenticator
Generates a deterministic UUID from the username without any network calls. Suitable for offline play or testing.
§Example
use lighty_auth::offline::OfflineAuth;
use lighty_auth::Authenticator;
#[tokio::main]
async fn main() {
let mut auth = OfflineAuth::new("Player123");
let profile = auth.authenticate().await.unwrap();
println!("UUID: {}", profile.uuid);
}Implementations§
Trait Implementations§
Source§impl Authenticator for OfflineAuth
impl Authenticator for OfflineAuth
Source§async fn authenticate(&mut self) -> AuthResult<UserProfile>
async fn authenticate(&mut self) -> AuthResult<UserProfile>
Authenticate a user and return their profile Read more
Source§fn verify(
&self,
token: &str,
) -> impl Future<Output = AuthResult<UserProfile>> + Send
fn verify( &self, token: &str, ) -> impl Future<Output = AuthResult<UserProfile>> + Send
Verify if a token is still valid Read more
Auto Trait Implementations§
impl Freeze for OfflineAuth
impl RefUnwindSafe for OfflineAuth
impl Send for OfflineAuth
impl Sync for OfflineAuth
impl Unpin for OfflineAuth
impl UnwindSafe for OfflineAuth
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more