What is the difference between 'a and 'static

'a is a generic lifetime parameter for flexible reference durations, while 'static is a fixed lifetime lasting the entire program execution.

The 'a lifetime parameter is a generic placeholder that must be inferred or explicitly defined to ensure references are valid for a specific duration, while 'static is a specific lifetime that lasts for the entire duration of the program.

// 'a is a generic lifetime parameter
fn first_word<'a>(s: &'a str) -> &'a str {
    // ...
}

// 'static is a concrete lifetime (e.g., string literals)
fn get_message() -> &'static str {
    "Hello, world!"
}