1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-10-06 19:00:48 +00:00
continuwuity/src/core/pdu/id.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
506 B
Rust
Raw Normal View History

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())),
}
}
}