Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_net/src/id.rs

655 bytes, 3 runs

created by r1870400018:587, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1use oxedyne_fe2o3_jdat::id::IdDat;
2
3use std::{
4 mem,
5};
6
7//// Protocol identifier types for defaults and testing.
8pub type BidTyp = u64; // Bot Id
9pub type MidTyp = u64; // Message Id
10pub type SidTyp = u64; // State Id (e.g. for sessions)
11pub type UidTyp = u128; // User Id
12
13pub const BID_LEN: usize = mem::size_of::<BidTyp>();
14pub const MID_LEN: usize = mem::size_of::<MidTyp>();
15pub const SID_LEN: usize = mem::size_of::<SidTyp>();
16pub const UID_LEN: usize = mem::size_of::<UidTyp>();
17
18pub type Bid = IdDat<{BID_LEN}, BidTyp>;
19pub type Mid = IdDat<{MID_LEN}, MidTyp>;
20pub type Sid = IdDat<{SID_LEN}, SidTyp>;
21pub type Uid = IdDat<{UID_LEN}, UidTyp>;