-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connect: impl trait for player context
- Loading branch information
1 parent
3cf4197
commit eb14e46
Showing
5 changed files
with
25 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod player_context; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::player::Context; | ||
use protobuf::Message; | ||
use std::hash::{Hash, Hasher}; | ||
|
||
impl Hash for Context { | ||
fn hash<H: Hasher>(&self, state: &mut H) { | ||
if let Ok(ctx) = self.write_to_bytes() { | ||
ctx.hash(state) | ||
} | ||
} | ||
} | ||
|
||
impl Eq for Context {} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// This file is parsed by build.rs | ||
// Each included module will be compiled from the matching .proto definition. | ||
|
||
mod impl_trait; | ||
|
||
include!(concat!(env!("OUT_DIR"), "/mod.rs")); |