#[allow(unused_imports)]
use super::*;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct AttachmentFlags(u16);
impl AttachmentFlags {
pub const EMBEDDED: u16 = 0x0001;
pub const COMPRESSED: u16 = 0x0002;
pub const MD5_VALID: u16 = 0x0004;
pub fn from_u16(value: u16) -> Self {
Self(value)
}
pub fn as_u16(self) -> u16 {
self.0
}
pub fn is_embedded(self) -> bool {
self.0 & Self::EMBEDDED != 0
}
pub fn is_compressed(self) -> bool {
self.0 & Self::COMPRESSED != 0
}
pub fn is_md5_valid(self) -> bool {
self.0 & Self::MD5_VALID != 0
}
pub fn embedded() -> Self {
Self(Self::EMBEDDED)
}
pub fn embedded_compressed() -> Self {
Self(Self::EMBEDDED | Self::COMPRESSED)
}
pub fn external() -> Self {
Self(0)
}
}