Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(dead_code)]
- struct FirstState;
- struct SecondState;
- struct Thing<T> {
- state: T,
- num: i32,
- }
- // Methods in this impl apply to all instances of Thing
- impl<T> Thing<T> {
- fn foo() {
- }
- }
- // Methods here only exist on Thing<FirstState>
- impl Thing<FirstState> {
- fn a() {
- }
- }
- // Methods here only exist on Thing<SecondState>
- impl Thing<SecondState> {
- fn b() {
- }
- }
- fn main() {
- println!("asdf");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement