Macro query_interface::mopo [] [src]

macro_rules! mopo {
    ($name:ty) => { ... };
}

Define a custom Object-like trait. The query, query_ref an query_mut methods will be automatically implemented on this trait object.

You may add additional static bounds to your custom trait via the HasInterface<I> trait. This example will statically ensure that all types convertible to MyObject can be cloned. Your trait must extend Object.

trait MyObject: Object + ObjectClone + HasInterface<ObjectClone> { }
mopo!(MyObject);