Trait darling_core::usage::UsesLifetimes

source ·
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§

source

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§

source

fn uses_lifetimes_cloned( &self, options: &Options, lifetimes: &LifetimeSet, ) -> LifetimeSet

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

Implementations on Foreign Types§

source§

impl UsesLifetimes for Fields

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for Data

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for GenericParam

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for TypeParamBound

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for WherePredicate

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for GenericArgument

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for PathArguments

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for ReturnType

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for Type

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for Field

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for FieldsNamed

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for Variant

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for DataEnum

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for DataStruct

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for DataUnion

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for BoundLifetimes

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for ConstParam

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for LifetimeParam

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for PredicateLifetime

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for PredicateType

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TraitBound

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeParam

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for Lifetime

source§

fn uses_lifetimes<'a>( &self, _: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for AngleBracketedGenericArguments

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for AssocType

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for Constraint

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for ParenthesizedGenericArguments

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for Path

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for PathSegment

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for QSelf

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for BareFnArg

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeArray

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeBareFn

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeGroup

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeImplTrait

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeParen

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypePath

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl UsesLifetimes for TypePtr

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeReference

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeSlice

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeTraitObject

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl UsesLifetimes for TypeTuple

source§

fn uses_lifetimes<'gen>( &self, options: &Options, type_set: &'gen LifetimeSet, ) -> LifetimeRefSet<'gen>

source§

impl<T: UsesLifetimes> UsesLifetimes for Option<T>

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl<T: UsesLifetimes> UsesLifetimes for Vec<T>

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

source§

impl<T: UsesLifetimes, U> UsesLifetimes for Punctuated<T, U>

source§

fn uses_lifetimes<'a>( &self, options: &Options, lifetimes: &'a LifetimeSet, ) -> LifetimeRefSet<'a>

Implementors§

source§

impl UsesLifetimes for Ignored

source§

impl<T: UsesLifetimes> UsesLifetimes for darling_core::ast::Fields<T>

source§

impl<V: UsesLifetimes, F: UsesLifetimes> UsesLifetimes for darling_core::ast::Data<V, F>