Rust Lifetimes Struct Fields

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

struct Struct<'a> {
    x: &'a u32,
}

This specifies that any given instance of Struct has lifetime 'a, and the &u32 stored in x must have a lifetime of at least 'a.



Got any Rust Question?