Created
February 25, 2014 18:33
-
-
Save cceckman/9214876 to your computer and use it in GitHub Desktop.
Method calls in Rust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait ScreenCanvas{ | |
| fn sync(&Self) -> bool; | |
| fn setResolution(&Self) -> bool; | |
| } | |
| struct screen_buffer_info{ | |
| x : uint; | |
| } | |
| impl ScreenCanvas for screen_buffer_info{ | |
| fn sync(&self) -> bool{ | |
| true | |
| } | |
| fn setResolution(&self) -> bool{ | |
| self.sync() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment