Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mod amethyst {
- pub struct Builder;
- impl Builder {
- pub fn with_resource(self) -> Self {
- self
- }
- }
- }
- mod phythyst {
- pub trait PhythystBuilderExt: Sized {
- fn with_physics(self, physics: usize) -> Self;
- }
- impl PhythystBuilderExt for crate::amethyst::Builder {
- fn with_physics(self, _physics: usize) -> Self {
- println!("Here you can register stuff!");
- self
- }
- }
- }
- fn main() {
- use phythyst::PhythystBuilderExt;
- let _x = amethyst::Builder
- .with_resource()
- // voilá
- .with_physics(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement