mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-10-06 19:00:48 +00:00
23 lines
506 B
Rust
23 lines
506 B
Rust
|
use super::{PduCount, RawPduId};
|
||
|
use crate::utils::u64_from_u8x8;
|
||
|
|
||
|
pub type ShortRoomId = ShortId;
|
||
|
pub type ShortEventId = ShortId;
|
||
|
pub type ShortId = u64;
|
||
|
|
||
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||
|
pub struct PduId {
|
||
|
pub shortroomid: ShortRoomId,
|
||
|
pub shorteventid: PduCount,
|
||
|
}
|
||
|
|
||
|
impl From<RawPduId> for PduId {
|
||
|
#[inline]
|
||
|
fn from(raw: RawPduId) -> Self {
|
||
|
Self {
|
||
|
shortroomid: u64_from_u8x8(raw.shortroomid()),
|
||
|
shorteventid: PduCount::from_unsigned(u64_from_u8x8(raw.shorteventid())),
|
||
|
}
|
||
|
}
|
||
|
}
|