Macro dependent_view::to_view[][src]

macro_rules! to_view {
    ($dep:tt) => { ... };
}

Macro for obtaining views from DependentRc

Error

It is a compile time error to use this macro to produce a view for a trait that the underlying struct does not implement.

Examples

struct ExampleStruct {
   // arbitrary fields
}
trait ExampleTrait {
  fn example_method(&self);
}
impl ExampleTrait for ExampleStruct {
             // some implementation...
}
let mut item : DependentRc<ExampleStruct> = DependentRc::new(ExampleStruct::new());
let view : Weak<ExampleTrait> = to_view!(item);