#[sails_type]Expand description
Derives the canonical Sails type bundle: Encode, Decode, TypeInfo,
and ReflectHash, together with their crate = helper attributes routed
to the sails_rs re-exports.
§Arguments
crate = <path>— override the path to thesails-rscrate (defaults tosails_rs). Useful whensails-rsis re-exported from a parent crate.no_reflect_hash— omitReflectHashfrom the derive list and drop thereflect_hashhelper attribute. Exists specifically for the IDL v1 client generator, which predatesReflectHash.
§Examples
ⓘ
use sails_rs::sails_type;
#[sails_type]
#[derive(PartialEq, Clone, Debug)]
pub struct MyType {
pub a: u32,
pub b: String,
}
#[sails_type(crate = my_alias)]
pub enum MyEnum { A, B }
#[sails_type(no_reflect_hash)]
pub struct LegacyType { pub a: u32 }Composes with #[event] in any order — the two macros are orthogonal.