Derive Macro arma_rs::FromArma

source ·
#[derive(FromArma)]
{
    // Attributes available to this derive:
    #[arma]
}
Expand description

Derive implementation of FromArma, only supports structs.

  • Map structs are converted from an hashmap.
  • Tuple structs are converted from an array.
  • Newtype structs directly use’s the value’s FromArma implementation.
  • Unit-like structs are not supported.

§Container Attributes

  • #[arma(transparent)]: treat single field map structs as if its a newtype structs.
  • #[arma(default)]: any missing field will be filled by the structs Default implementation.

§Field Attributes

  • #[arma(from_str)]: use the types std::str::FromStr instead of FromArma.
  • #[arma(default)]: if missing use its Default implementation (takes precedence over container).