use rsynko_x::*;
#[derive(Clone, Copy, Debug, Default)]
pub struct ReferenceXEnv;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct XAttachment {
identity: String,
kind: AttachmentKind,
address: String,
}
impl XSorts for ReferenceXEnv {
type Request = String;
type Attachment = XAttachment;
}
impl XRequestAlg for ReferenceXEnv {
fn tweet_request(&self, address: impl Into<String>) -> String {
address.into()
}
}
impl XRequestViewAlg for ReferenceXEnv {
fn request_address<'a>(&self, request: &'a String) -> &'a str {
request
}
}
impl XAttachmentAlg for ReferenceXEnv {
fn attachment(
&self,
identity: impl Into<String>,
kind: AttachmentKind,
address: impl Into<String>,
) -> XAttachment {
XAttachment {
identity: identity.into(),
kind,
address: address.into(),
}
}
}
impl XAttachmentViewAlg for ReferenceXEnv {
fn attachment_identity<'a>(&self, attachment: &'a XAttachment) -> &'a str {
&attachment.identity
}
fn attachment_kind(&self, attachment: &XAttachment) -> AttachmentKind {
attachment.kind
}
fn attachment_address<'a>(&self, attachment: &'a XAttachment) -> &'a str {
&attachment.address
}
}