darling_core::usage

Trait 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>