use crate::alloc::boxed::Box;
use crate::mechanisms::anonymous::{client, server};
use crate::mechname::Mechname;
use crate::property::Property;
use crate::registry::{Matches, Mechanism, Named};
use crate::session::Side;
#[non_exhaustive]
pub struct AnonymousToken;
impl Property<'_> for AnonymousToken {
type Value = str;
}
#[cfg_attr(
feature = "registry_static",
linkme::distributed_slice(crate::registry::MECHANISMS)
)]
pub static ANONYMOUS: Mechanism = Mechanism {
mechanism: Mechname::const_new(b"ANONYMOUS"),
priority: 100,
client: Some(|| Ok(Box::new(client::Anonymous))),
server: Some(|_sasl| Ok(Box::new(server::Anonymous))),
first: Side::Client,
select: |_| Some(Matches::<Select>::name()),
offer: |_| true,
};
struct Select;
impl Named for Select {
fn mech() -> &'static Mechanism {
&ANONYMOUS
}
}