Rust Create Derive Trait

[Solved] Rust Create Derive Trait | Rust - Code Explorer | yomemimo.com
Question : rust create derive trait

Answered by : talented-tapir-w9w3z99z6qka

#[macro_use]
extern crate hello_world_derive;
trait HelloWorld { fn hello_world();
}
#[derive(HelloWorld)]
struct FrenchToast;
#[derive(HelloWorld)]
struct Waffles;
fn main() { FrenchToast::hello_world(); Waffles::hello_world();
}

Source : https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/procedural-macros.html | Last Update : Mon, 18 Apr 22

Answers related to rust create derive trait

Code Explorer Popular Question For Rust