axsys_noun/
marker.rs

1//! Marker traits.
2
3use crate::{atom::Atom, cell::Cell, noun::Noun};
4
5macro_rules! impl_marker {
6    ($trait:ty, $type:ty) => {
7        impl $trait for $type {}
8        impl $trait for &$type {}
9        impl $trait for std::boxed::Box<$type> {}
10        impl $trait for std::rc::Rc<$type> {}
11        impl $trait for std::sync::Arc<$type> {}
12    };
13}
14
15/// Atom-like types.
16pub trait Atomish {}
17
18impl_marker!(Atomish, Atom);
19
20/// Cell-like types.
21pub trait Cellish {}
22
23impl_marker!(Cellish, Cell);
24
25/// Noun-like types.
26pub trait Nounish {}
27
28impl_marker!(Nounish, Atom);
29impl_marker!(Nounish, Cell);
30impl_marker!(Nounish, Noun);