use crate::XSorts;
use alux_sdk::case_mapping;
pub trait XAttachmentAlg: XSorts {
fn attachment(
&self,
identity: impl Into<String>,
kind: AttachmentKind,
address: impl Into<String>,
) -> Self::Attachment;
}
pub trait XAttachmentViewAlg: XSorts {
fn attachment_identity<'a>(&self, attachment: &'a Self::Attachment) -> &'a str;
fn attachment_kind(&self, attachment: &Self::Attachment) -> AttachmentKind;
fn attachment_address<'a>(&self, attachment: &'a Self::Attachment) -> &'a str;
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AttachmentKind {
Photo,
Video,
Animation,
}
case_mapping! {
AttachmentKind, &'static str as &str,
Photo <=> "photo",
Video <=> "video",
Animation <=> "animated_gif",
}