logo

Macro actyx_sdk::arcval_scalar[][src]

macro_rules! arcval_scalar {
    ($($(#[$attr : meta]) * $vis : vis struct $id : ident(str) $(;) ?) *) => { ... };
}
Expand description

Helper macro to create interned string types

use actyx_sdk::arcval_scalar;

arcval_scalar! {
    /// some docs
    pub struct Name(str);
}

arcval_scalar! { struct Private(str) }

let n: Name = Name::from("Bob");
let p: Private = Private::from("x".to_owned());

The declared wrapper struct derives instances for the standard library traits Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash. You can add more with the usual #[derive()] attribute.