Derive Macro pasture_derive::PointType[][src]

#[derive(PointType)]
{
    // Attributes available to this derive:
    #[pasture]
}

Custom derive macro that implements the PointType trait for the type that it is applied to.

Any that that wants to implement PointType using this derive macro must fulfill the following requirements:

  • It must be at least one of #[repr(C)] and #[repr(packed)]
  • All its members may only be Pasture primitive types
  • Each member must contain an attribute #[pasture(X)], where X is either one of the builtin attributes explained below, or attribute = "name" for a custom attribute named name
  • No two members may share the same attribute name

Builtin attributes

To associate a member of a custom PointType with one of the builtin point attributes in Pasture, use the #[pasture(X)] attribute, where X is one of:

Custom attributes

To associate a member of a custom PointType with a point attribute with custom name, use the #[pasture(attribute = "name")] attribute