tailvore_examples 0.19.0

Examples for the tailvore crate.
Documentation
use tailvore::self_referencing;

#[self_referencing]
struct BoxAndRef {
    data: i32,
    #[borrows(data)]
    data_ref: &'this i32,
}

fn main() {
    let instance = BoxAndRefBuilder {
        data: 12,
        data_ref_builder: |dref| dref,
    }
    .build();
    let data_ref = instance.with_data_ref(|dref| *dref);
    drop(instance);
    println!("{:?}", data_ref);
}