Macro three::three_object_wrapper [] [src]

macro_rules! three_object_wrapper {
    ($($name:ident),*) => { ... };
    ($($name:ident::$field:ident),*) => { ... };
}

Implements conversion traits on a type wrapping a three-rs type. Useful for when you wrap a three-rs type with your own struct. Allows you to use that struct in place of any three-rs object.

Implements the following traits:

  • AsRef<NodePointer>
  • Deref<Target=Object>
  • DerefMut<Object>
// Implements conversion traits for MyStruct using field `internal_three_type`
three_object_wrapper!(MyStruct::internal_three_type);
// If field is omitted, it defaults to `object`
three_object_wrapper!(MyStruct); // equivalent to three_object_wrapper!(MyStruct::object);