abstract_impl

Attribute Macro abstract_impl 

Source
#[abstract_impl]
Expand description

Define an abstract implementation for a trait, that types can use

#[abstract_impl]
impl Impl for SomeTrait where Self: Default + std::fmt::Debug {
  fn some() -> Self {
    Self::default()
  }
  fn other(&self) -> String {
    // You have to use context here instead of self, because we don't change macro contents
    format!("{context:?}")
  }
}
impl_Impl!(());