pub trait UsesLifetimes {
    fn uses_lifetimes<'a>(
        &self,
        options: &Options,
        lifetimes: &'a LifetimeSet
    ) -> LifetimeRefSet<'a>; fn uses_lifetimes_cloned(
        &self,
        options: &Options,
        lifetimes: &LifetimeSet
    ) -> LifetimeSet { ... } }
Expand description

Searcher for finding lifetimes in a syntax tree. This can be used to determine which lifetimes must be emitted in generated code.

Required methods

Returns the subset of the queried lifetimes that are used by the implementing syntax element.

This method only accounts for direct usage by the element; indirect usage via bounds or where predicates are not detected.

Provided methods

Find all used lifetimes, then clone them and return that set.

Implementations on Foreign Types

Implementors