use core::fmt;
#[derive(Debug, Clone, Default, PartialEq, Eq)]
#[cfg_attr(test, derive(fake::Dummy))]
pub struct Extensions {
pub user_timestamp: Option<UserTimestampExt>,
pub e2ee: Option<E2eeExt>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(test, derive(fake::Dummy))]
pub struct UserTimestampExt(pub u64);
#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(test, derive(fake::Dummy))]
pub struct E2eeExt {
pub key_index: u8,
pub iv: [u8; 12],
}
impl fmt::Debug for E2eeExt {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("E2ee").finish()
}
}
pub(super) type ExtensionTag = u8;
impl UserTimestampExt {
pub(super) const TAG: ExtensionTag = 2;
pub(super) const LEN: usize = 8;
}
impl E2eeExt {
pub(super) const TAG: ExtensionTag = 1;
pub(super) const LEN: usize = 13;
}