mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-13 18:59:00 -05:00
move core::pdu and core::state_res into core::matrix::
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
4e5b87d0cd
commit
532dfd004d
91 changed files with 266 additions and 205 deletions
22
src/core/matrix/pdu/id.rs
Normal file
22
src/core/matrix/pdu/id.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use super::{Count, RawId};
|
||||
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 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())),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue