Skip to main content

Module typed_dataframe

Module typed_dataframe 

Source
Expand description

Parser and expansion for the typed_dataframe! macro.

Generates a struct that wraps an R data.frame, validates declared columns via TryFromSexp, and exposes borrowed per-column accessors.

§Syntax

typed_dataframe! {
    /// The shape we accept for the Theoph PK dataset.
    pub TheophDf {
        subject: i32,
        weight: f64,
        dose: f64,
        flag: Option<i32>,   // optional column
    }
}

Expands to a struct TheophDf with TryFromSexp and per-column accessors (subject() -> &[i32], flag() -> Option<&[i32]>).

Structs§

TypedDataframeField
A single column declaration.
TypedDataframeInput
Parsed input for typed_dataframe!.

Functions§

expand_typed_dataframe
Expand a parsed typed_dataframe! into the generated struct, impls, and per-column accessors.
unwrap_option 🔒
If ty is Option<T>, return T; otherwise None.