Skip to main content

having_message_code

Macro having_message_code 

Source
macro_rules! having_message_code {
    { $tn:ty, $mc:ident } => { ... };
}
Expand description

Implements Signable for the given struct. Use as follows:

use pubhubs::api::Signable;

#[derive(serde::Serialize, serde::Deserialize)]
struct T {};

pubhubs::api::having_message_code!{T, Example};

assert_eq!(T::CODE, pubhubs::api::MessageCode::Example);

Implements Signable for the given struct. Use as follows:

use pubhubs::api::Signable;

#[derive(serde::Serialize, serde::Deserialize)]
struct T {};

pubhubs::api::having_message_code!{T, Example};

assert_eq!(T::CODE, pubhubs::api::MessageCode::Example);