[][src]Macro replacer::rust_struct

macro_rules! rust_struct {
    ($_name:ident; $placeholder:ident {$($element: ident: $ty: ty),*};) => { ... };
    (pub $_name:ident; $placeholder:ident {$($element: ident: $ty: ty),*};) => { ... };
    ($_name:ident; $placeholder:ident<$lifetime:lifetime>{$($element: ident: $ty: ty),*};) => { ... };
    (pub $_name:ident; $placeholder:ident<$lifetime:lifetime>{$($element: ident: $ty: ty),*};) => { ... };
}

Template macro for replacing a Rust struct with a placeholder struct that can be compiled.

// Private
replacer::rust_struct!(replace_with_struct; Point2D { x: i32, y: i32 };);
// Public
replacer::rust_struct!(pub replace_with_other_struct; Point3D { x: i32, y: i32, z: i32 };);
// With a lifetime
replacer::rust_struct!(replace_with_struct; Point4D<'a> { x: i32, y: &'a i32, z: i32, w: i32 };);