Skip to main content

derive_into_list

Function derive_into_list 

Source
pub fn derive_into_list(input: DeriveInput) -> Result<TokenStream>
Expand description

Derive IntoList for structs (Rust -> R).

Generates an impl IntoList for T that converts the struct into an R list:

  • Named structs (struct Foo { x: i32 }) produce a named R list: list(x = 1L)
  • Tuple structs (struct Foo(i32, i32)) produce an unnamed R list: list(1L, 2L)
  • Unit structs (struct Foo) produce an empty R list: list()

Fields marked with #[into_list(ignore)] are excluded from the list. Each non-ignored field’s type must implement IntoR (enforced via where-clause bounds).

Returns Err if applied to a non-struct type or if an unknown field attribute is found.