Trait PersonProperty

Source
pub trait PersonProperty: Copy {
    type Value: Copy + Debug + PartialEq + Serialize;

    // Required methods
    fn compute(context: &Context, person_id: PersonId) -> Self::Value;
    fn get_instance() -> Self;
    fn name() -> &'static str;

    // Provided methods
    fn is_derived() -> bool { ... }
    fn is_required() -> bool { ... }
    fn dependencies() -> Vec<Box<dyn PersonPropertyHolder>> { ... }
    fn register_dependencies(_: &Context) { ... }
}
Expand description

An individual characteristic or state related to a person, such as age or disease status.

Person properties should be defined with the define_person_property!(), define_person_property_with_default!() and define_derived_property!() macros.

Required Associated Types§

Required Methods§

Source

fn compute(context: &Context, person_id: PersonId) -> Self::Value

Source

fn get_instance() -> Self

Source

fn name() -> &'static str

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§