-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce streamable_struct macro, to make it more succinct to define…
… new streamable types. The main fix is to make all members public
- Loading branch information
Showing
6 changed files
with
34 additions
and
23 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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#[cfg(feature = "py-bindings")] | ||
pub mod from_json_dict; | ||
#[cfg(feature = "py-bindings")] | ||
pub mod to_json_dict; | ||
|
||
pub mod bls; | ||
pub mod bytes; | ||
pub mod chia_error; | ||
pub mod coin; | ||
pub mod coin_state; | ||
#[cfg(feature = "py-bindings")] | ||
pub mod from_json_dict; | ||
pub mod message_struct; | ||
pub mod respond_to_ph_updates; | ||
pub mod streamable; | ||
#[cfg(feature = "py-bindings")] | ||
pub mod to_json_dict; |
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,10 @@ | ||
#[macro_export] | ||
macro_rules! streamable_struct { | ||
($name:ident {$($field:ident: $t:ty $(,)? )*}) => { | ||
#[cfg_attr(feature = "py-bindings", pyclass, derive(PyStreamable))] | ||
#[derive(Streamable, Hash, Debug, Clone, Eq, PartialEq)] | ||
pub struct $name { | ||
$(pub $field: $t),* | ||
} | ||
} | ||
} |
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