## box-dyn
[](https://github.com/romnn/box-dyn/actions/workflows/build.yml)
[](https://github.com/romnn/box-dyn/actions/workflows/test.yml)
[](https://crates.io/crates/box-dyn)
[](https://docs.rs/box-dyn)
A simple macro, here is how to use it:
```rust
#[box_dyn::box_dyn]
trait MyTrait {
fn method_a(&self, param: usize) -> String;
fn method_b(&mut self);
}
```
This will automatically implement `MyTrait` for `Box`:
```rust
impl MyTrait for Box where T: MyTrait {
fn method_a(&self, param: usize) -> String {
MyTrait::method_a(self.as_ref(), param)
}
fn method_b(&mut self) {
MyTrait::method_b(self.as_mut())
}
}
```