Skip to content

Instantly share code, notes, and snippets.

@TheOpenDevProject
Created October 27, 2015 03:34
Show Gist options
  • Select an option

  • Save TheOpenDevProject/a5353a07af7ffa3c8613 to your computer and use it in GitHub Desktop.

Select an option

Save TheOpenDevProject/a5353a07af7ffa3c8613 to your computer and use it in GitHub Desktop.
namespace Example{
class MyClass{
public:
void ReadStuff() const;
int CalcStuff() const;
int AddStuff();
private:
int _number;
};
}
@durka
Copy link
Copy Markdown

durka commented Oct 27, 2015

mod example {
    pub struct MyClass {
        number: i32
    }

    impl MyClass {
        pub fn read_stuff(&self) { ... }
        pub fn calc_stuff(&self) -> i32 { ... }
        pub fn add_stuff(&mut self) -> i32 { ... }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment