Macro dependent_view::to_view_sync[][src]

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

Macro for obtaining thread safe views from DependentArc

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 : DependentArc<ExampleStruct> = DependentArc::new(ExampleStruct::new());
let view : Weak<ExampleTrait> = to_view_sync!(item);