How do you read lifetimes?

If you are to say a type with a lifetime out loud, how would you say it?

For example, how would you read the Dispatcher type below and its fields?

pub struct Dispatcher<'a, 'b> {
    stages: Vec<Stage<'a>>,
    thread_local: ThreadLocal<'b>,
    #[cfg(not(target_os = "emscripten"))]
    thread_pool: ::std::sync::Arc<::rayon::ThreadPool>,
}

I think having a standard way to describe types can be immensely helpful.

“Dispatcher is a public struct parametrized by lifetimes a and b, containing stages, a Vec of Stages of lifetime a, thread_local, a ThreadLocal of lifetime b, and also on non-emscripten platforms, thread_pool, an Arc'ed rayon ThreadPool.” ​:P

6 Likes