1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
//! # Examples
//!
//! ```
//! use hdi::prelude::*;
//! #[hdk_entry_helper]
//! pub struct Post(pub String);
//! #[hdk_entry_helper]
//! pub struct Msg(pub String);
//!
//! #[hdk_entry_helper]
//! pub struct PrivMsg(pub String);
//!
//! #[hdk_entry_defs]
//! #[unit_enum(UnitEntryTypes)]
//! pub enum EntryTypes {
//! Post(Post),
//! #[entry_def(required_validations = 5)]
//! Msg(Msg),
//! #[entry_def(name = "hidden_msg", required_validations = 5, visibility = "private")]
//! PrivMsg(PrivMsg),
//! }
//! # fn main() {
//! assert_eq!(__num_entry_types(), 3);
//! # }
//! ```
use self::hdi::prelude::*;
use crate as hdi;
#[hdk_entry_helper]
pub struct Post(pub String);
#[hdk_entry_helper]
pub struct Msg(pub String);
#[hdk_entry_helper]
pub struct PrivMsg(pub String);
#[hdk_entry_defs]
#[unit_enum(UnitEntryTypes)]
pub enum EntryTypes {
Post(Post),
#[entry_def(required_validations = 5)]
Msg(Msg),
#[entry_def(name = "hidden_msg", required_validations = 5, visibility = "private")]
PrivMsg(PrivMsg),
}