Skip to main content

derive_try_from_list

Function derive_try_from_list 

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

Derive TryFromList for structs (R -> Rust).

Generates an impl TryFromList for T that extracts struct fields from an R list:

  • Named structs: extract by field name from a named R list
  • Tuple structs: extract by position (index 0, 1, 2, …)
  • Unit structs: accept any list (no extraction needed)

Fields marked with #[into_list(ignore)] are filled with Default::default(). Each non-ignored field’s type must implement TryFromSexp (enforced via where-clause bounds).

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