What are the lifetime 'a, 'b?

Clap::App have lifetime 'a, 'b, which are not specified, and the calling code like this:

fn test() {
    let app = clap::App::new("111"); // App<'a, 'b>
    let matches = app.get_matches(); //  return ArgMatches<'a> 
}

The question is what does 'a, 'b means?
I can image matches holds some &'a T, but what is the 'a?

The clap code is as below:

pub struct App<'a, 'b>
where
    'a: 'b,
{
    #[doc(hidden)]
    pub p: Parser<'a, 'b>,
}


impl<'a, 'b> App<'a, 'b> {
    pub fn new<S: Into<String>>(n: S) -> Self {
        App {
            p: Parser::with_name(n.into()),
        }
    }

    pub fn get_matches(self) -> ArgMatches<'a> {
        self.get_matches_from(&mut env::args_os())
    }


    [...]
}

pub struct Parser<'a, 'b>
where
    'a: 'b,
{
    pub meta: AppMeta<'b>,
    settings: AppFlags,
    pub g_settings: AppFlags,
    pub flags: Vec<FlagBuilder<'a, 'b>>,
    [...]
}

impl<'a, 'b> Parser<'a, 'b>
where
    'a: 'b,
{
    pub fn with_name(n: String) -> Self {
        Parser {
            meta: AppMeta::with_name(n),
            g_settings: AppFlags::zeroed(),
            cur_idx: Cell::new(0),
            ..Default::default()
        }
    }

    [...]
}

Which Parser type is this?

pub struct Parser<'a, 'b>
where
    'a: 'b,
{
    pub meta: AppMeta<'b>,
    settings: AppFlags,
    pub g_settings: AppFlags,
    pub flags: Vec<FlagBuilder<'a, 'b>>,
    [...]
}

impl<'a, 'b> Parser<'a, 'b>
where
    'a: 'b,
{
    pub fn with_name(n: String) -> Self {
        Parser {
            meta: AppMeta::with_name(n),
            g_settings: AppFlags::zeroed(),
            cur_idx: Cell::new(0),
            ..Default::default()
        }
    }

    [...]
}

Having signature 'a, 'b, but can be constructed with a String

Note that clap::App has been deprecated in favor of clap::Command. This has only one lifetime parameter ’help. Looking at where it’s used, this appears to be the lifetime of the help text that clap can emit, as all of the methods to add new flags and such take Into<&’help str>. In the case where these are hard-coded into the program, I’d expect ’help == ‘static.

It is not about the usage of clap, but the lifetime syntax involved.

Basically, the structure is declared to hold references of the form &’a… and &’b… embedded in it somewhere, presumably inside a container that starts empty. The actual value of these lifetimes don’t have to be determined at object creation time, but can instead be inferred by the compiler when methods are called that involve them.

As I can’t find any documentation or source code for the version with two lifetime parameters, I can’t say any more about what they represent. Probably, one of them serves the same purpose as ’help in the current version of clap.