Last active
March 30, 2022 15:12
-
-
Save jayhuang75/f5b3d6b524327f6cf5ab38e563f4ba08 to your computer and use it in GitHub Desktop.
token_bucket_trait
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
| pub trait Actions { | |
| fn forward(&self, people: i64); | |
| fn queue(&self, people: i64); | |
| } | |
| impl Actions for TokenBucket { | |
| fn forward(&self, people: i64) { | |
| println!("-> forward : {:?} people", people); | |
| } | |
| fn queue(&self, people: i64){ | |
| println!("<- queue : {:?} people", people); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment