// Copyright 2022-2024 Gabriel Bjørnager Jensen. use bzipper::{Deserialise, Serialise}; use std::fmt::{Debug, Display, Formatter}; #[derive(Clone, Copy, Eq, Deserialise, PartialEq, Serialise)] #[repr(align(0x10))] pub struct SessionToken { pub time: u64, pub key: u64, } impl Debug for SessionToken { #[inline(always)] fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { write!(f, "{self}") } } impl Display for SessionToken { #[inline(always)] fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { write!(f, "{:016X}:{:016X}", self.time, self.key) } }