pub trait UsesLifetimes {
// Required method
fn uses_lifetimes<'a>(
&self,
options: &Options,
lifetimes: &'a LifetimeSet,
) -> LifetimeRefSet<'a>;
// Provided method
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§
sourcefn uses_lifetimes<'a>(
&self,
options: &Options,
lifetimes: &'a LifetimeSet,
) -> LifetimeRefSet<'a>
fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>
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§
sourcefn uses_lifetimes_cloned(
&self,
options: &Options,
lifetimes: &LifetimeSet,
) -> LifetimeSet
fn uses_lifetimes_cloned( &self, options: &Options, lifetimes: &LifetimeSet, ) -> LifetimeSet
Find all used lifetimes, then clone them and return that set.