-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add relevant section of Protocol spec to message mod and variant docs Depend on serde{,_json}. Dev-depend on rand Credit Katt in Cargo.toml
- Loading branch information
1 parent
ec6f39a
commit 63eabdd
Showing
7 changed files
with
1,925 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,4 +6,12 @@ readme = "README.md" | |
keywords = ["game", "lounge", "server"] | ||
license = "MIT" | ||
version = "0.1.0" | ||
authors = ["nabijaczleweli <[email protected]>"] | ||
authors = ["nabijaczleweli <[email protected]>", | ||
"Cat Plus Plus <[email protected]>"] | ||
|
||
[dependencies] | ||
serde = "0.7" | ||
serde_json = "0.7" | ||
|
||
[dev-dependencies] | ||
rand = "0.3" |
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,15 @@ | ||
use serde_json; | ||
|
||
#[derive(Debug)] | ||
pub enum MessageError { | ||
JsonError(serde_json::Error), | ||
PropertyMissing(String), | ||
ExtraneousProperty(String), | ||
BadType(String), | ||
} | ||
|
||
impl From<serde_json::Error> for MessageError { | ||
fn from(sje: serde_json::Error) -> Self { | ||
MessageError::JsonError(sje) | ||
} | ||
} |
Oops, something went wrong.