Trait darling::usage::UsesTypeParams[][src]

pub trait UsesTypeParams {
    fn uses_type_params(
        &self,
        options: &Options,
        type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
    ) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>; fn uses_type_params_cloned(
        &self,
        options: &Options,
        type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
    ) -> HashSet<Ident, BuildHasherDefault<FnvHasher>> { ... } }
Expand description

Searcher for finding type params in a syntax tree. This can be used to determine if a given type parameter needs to be bounded in a generated impl.

Required methods

fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

Returns the subset of the queried type parameters 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

fn uses_type_params_cloned(
    &self,
    options: &Options,
    type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<Ident, BuildHasherDefault<FnvHasher>>
[src]

Find all type params using uses_type_params, then clone the found values and return the set.

Implementations on Foreign Types

impl UsesTypeParams for TypePath[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for DataEnum[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Fields[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for GenericArgument[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Ident[src]

Check if an Ident exactly matches one of the sought-after type parameters.

pub fn uses_type_params(
    &self,
    _options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Variant[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Binding[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for ReturnType[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeTuple[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for FieldsNamed[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeParen[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeSlice[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for DataUnion[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for PathArguments[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for WherePredicate[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Data[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeArray[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypePtr[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeGroup[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeBareFn[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for ()[src]

pub fn uses_type_params(
    &self,
    _options: &Options,
    _type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for AngleBracketedGenericArguments[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Constraint[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for PredicateType[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeParamBound[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl<T> UsesTypeParams for Option<T> where
    T: UsesTypeParams
[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl<T> UsesTypeParams for Vec<T, Global> where
    T: UsesTypeParams
[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Type[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for QSelf[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Path[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for ParenthesizedGenericArguments[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeImplTrait[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for DataStruct[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for BareFnArg[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for PredicateEq[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeTraitObject[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl<T, U> UsesTypeParams for Punctuated<T, U> where
    T: UsesTypeParams
[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TypeReference[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for TraitBound[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

impl UsesTypeParams for Field[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
[src]

Implementors

impl UsesTypeParams for Ignored[src]

pub fn uses_type_params(
    &self,
    _opts: &Options,
    &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl<T> UsesTypeParams for darling::ast::Fields<T> where
    T: UsesTypeParams
[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]

impl<V, F> UsesTypeParams for darling::ast::Data<V, F> where
    F: UsesTypeParams,
    V: UsesTypeParams
[src]

pub fn uses_type_params(
    &self,
    options: &Options,
    type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
[src]