Macro enso_shapely::define_singletons [−][src]
macro_rules! define_singletons { ( $( $(#$meta:tt)* $name:ident ),* $(,)? ) => { ... }; }
Expand description
Defines singleton types. For the following input:
ⓘ
define_singletons!{ /// A Foo! Foo, /// A Bar! Bar, }
It expands to:
#[allow(missing_docs)] #[derive(Copy, Clone, Debug)] #[doc = r###"A Foo!"###] pub struct Foo; impl Default for Foo { fn default() -> Self { Self } } #[allow(missing_docs)] #[derive(Copy, Clone, Debug)] #[doc = r###"A Bar!"###] pub struct Bar; impl Default for Bar { fn default() -> Self { Self } }