pub struct Auth {
pub protocol_version: u8,
pub auth_type: AuthType,
pub page: u8,
pub last_page_index: u8,
pub length: u8,
pub timestamp: u32,
pub data: [u8; 23],
}Expand description
One page of an authentication message.
Page 0 carries the header fields and 17 data bytes; pages 1 to 15 carry
23 data bytes each. crate::UasData::auth_data joins the pages.
Fields§
§protocol_version: u8Protocol version from the header.
auth_type: AuthTypeAuthentication scheme.
page: u8Page number, 0 to 15.
last_page_index: u8Page 0 only: index of the last page.
length: u8Page 0 only: total length of the authentication data in bytes.
timestamp: u32Page 0 only: seconds since 2019-01-01 00:00:00 UTC.
data: [u8; 23]Data bytes of this page (17 on page 0, 23 on others; the rest is zero).
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn decode(raw: &[u8; 25]) -> Result<Self, Error>
pub fn decode(raw: &[u8; 25]) -> Result<Self, Error>
Decodes an authentication page, with the same consistency checks as the reference library (page 0 must announce a length that fits in its pages).
Sourcepub fn page_data(&self) -> &[u8] ⓘ
pub fn page_data(&self) -> &[u8] ⓘ
The data bytes this page carries (17 on page 0, 23 otherwise).
Sourcepub fn unix_timestamp(&self) -> u64
pub fn unix_timestamp(&self) -> u64
Page 0 timestamp as Unix seconds.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Auth
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Auth
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Auth
impl StructuralPartialEq for Auth
Auto Trait Implementations§
impl Forget for Auth
impl Freeze for Auth
impl Move for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
impl UnwindSafe for Auth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more