mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 20:56:49 +00:00
Co-authored-by: Jade Ellis <jade@ellis.link> Signed-off-by: Jason Volk <jason@zemos.net>
24 lines
516 B
Rust
24 lines
516 B
Rust
use super::{Count, RawId};
|
|
use crate::utils::u64_from_u8x8;
|
|
|
|
pub type ShortRoomId = ShortId;
|
|
pub type ShortEventId = ShortId;
|
|
pub type ShortStateKey = ShortId;
|
|
pub type ShortId = u64;
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
pub struct Id {
|
|
pub shortroomid: ShortRoomId,
|
|
pub shorteventid: Count,
|
|
}
|
|
|
|
impl From<RawId> for Id {
|
|
#[inline]
|
|
fn from(raw: RawId) -> Self {
|
|
Self {
|
|
shortroomid: u64_from_u8x8(raw.shortroomid()),
|
|
shorteventid: Count::from_unsigned(u64_from_u8x8(raw.shorteventid())),
|
|
}
|
|
}
|
|
}
|