thin_trait_object 1.1.2

One pointer wide trait objects which are also FFI safe, allowing traits to be passed to/from and implemented by C ABI code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thin_trait_object::*;

#[thin_trait_object]
trait Foo {
    fn fooify(&self, extra_data: &str);
}
impl Foo for String {
    fn fooify(&self, extra_data: &str) {
        println!(
            "Fooified a string: \"{}\" with extra data: \"{}\"",
            self, extra_data
        );
    }
}

fn main() {
    BoxedFoo::new("Hello World!".to_string()).fooify("Another string!");
}