Trait darling_core::usage::UsesTypeParams
source · [−]pub trait UsesTypeParams {
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>;
fn uses_type_params_cloned(
&self,
options: &Options,
type_set: &IdentSet
) -> IdentSet { ... }
}
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<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
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: &IdentSet
) -> IdentSet
fn uses_type_params_cloned(
&self,
options: &Options,
type_set: &IdentSet
) -> IdentSet
Find all type params using uses_type_params
, then clone the found values and return the set.
Implementations on Foreign Types
sourceimpl UsesTypeParams for ()
impl UsesTypeParams for ()
fn uses_type_params<'a>(
&self,
_options: &Options,
_type_set: &'a IdentSet
) -> IdentRefSet<'a>
sourceimpl<T: UsesTypeParams> UsesTypeParams for Option<T>
impl<T: UsesTypeParams> UsesTypeParams for Option<T>
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
sourceimpl<T: UsesTypeParams> UsesTypeParams for Vec<T>
impl<T: UsesTypeParams> UsesTypeParams for Vec<T>
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
sourceimpl<T: UsesTypeParams, U> UsesTypeParams for Punctuated<T, U>
impl<T: UsesTypeParams, U> UsesTypeParams for Punctuated<T, U>
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
sourceimpl UsesTypeParams for AngleBracketedGenericArguments
impl UsesTypeParams for AngleBracketedGenericArguments
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for BareFnArg
impl UsesTypeParams for BareFnArg
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for Binding
impl UsesTypeParams for Binding
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for Constraint
impl UsesTypeParams for Constraint
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for DataEnum
impl UsesTypeParams for DataEnum
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for DataStruct
impl UsesTypeParams for DataStruct
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for DataUnion
impl UsesTypeParams for DataUnion
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for Field
impl UsesTypeParams for Field
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for FieldsNamed
impl UsesTypeParams for FieldsNamed
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for ParenthesizedGenericArguments
impl UsesTypeParams for ParenthesizedGenericArguments
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for PredicateEq
impl UsesTypeParams for PredicateEq
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for PredicateType
impl UsesTypeParams for PredicateType
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for QSelf
impl UsesTypeParams for QSelf
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TraitBound
impl UsesTypeParams for TraitBound
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeArray
impl UsesTypeParams for TypeArray
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeBareFn
impl UsesTypeParams for TypeBareFn
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeGroup
impl UsesTypeParams for TypeGroup
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeImplTrait
impl UsesTypeParams for TypeImplTrait
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeParen
impl UsesTypeParams for TypeParen
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypePtr
impl UsesTypeParams for TypePtr
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeReference
impl UsesTypeParams for TypeReference
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeSlice
impl UsesTypeParams for TypeSlice
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeTuple
impl UsesTypeParams for TypeTuple
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for TypeTraitObject
impl UsesTypeParams for TypeTraitObject
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for Variant
impl UsesTypeParams for Variant
fn uses_type_params<'gen>(
&self,
options: &Options,
type_set: &'gen IdentSet
) -> IdentRefSet<'gen>
sourceimpl UsesTypeParams for Data
impl UsesTypeParams for Data
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
sourceimpl UsesTypeParams for Fields
impl UsesTypeParams for Fields
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
sourceimpl UsesTypeParams for Ident
impl UsesTypeParams for Ident
Check if an Ident exactly matches one of the sought-after type parameters.