[][src]Macro activitystreams::properties

properties!() { /* proc-macro */ }

Generate structs and enums for activitystreams objects

use activitystreams_derive::properties;

#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
pub struct MyStruct;

properties! {
    Hello {
        docs [ "Defining the HelloProperties struct" ],

        field {
            types [ String ],
        },

        other_field {
            docs [
                "field documentation",
                "is cool",
            ],
            types [
                String,
                MyStruct,
            ],
            functional,
            required,
            rename("@other_field"),
            alias [
                "@second_field",
                "another_field",
            ],
        },
    }
}

let _ = HelloProperties::default();