The impl lifetime

As mentioned in Chapter 8, The Rust Application Lifetime, we can use a lifetime with an impl:

impl<'a> MyFunction<'a>(varname: &'a as i32) {...}

'a is denoted directly after both the impl and MyFunction. For the impl, it's to say we're using it, while after MyFunction, it's to say we're using it within MyFunction.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset