Trait darling::usage::UsesTypeParams
source · [−]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>>
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
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>>
fn uses_type_params_cloned(
&self,
options: &Options,
type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<Ident, BuildHasherDefault<FnvHasher>>
Find all type params using uses_type_params
, then clone the found values and return the set.
Implementations on Foreign Types
sourceimpl<T> UsesTypeParams for Option<T> where
T: UsesTypeParams,
impl<T> UsesTypeParams for Option<T> where
T: UsesTypeParams,
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for FieldsNamed
impl UsesTypeParams for FieldsNamed
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for Field
impl UsesTypeParams for Field
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for TypeParamBound
impl UsesTypeParams for TypeParamBound
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for TypeParen
impl UsesTypeParams for TypeParen
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for ParenthesizedGenericArguments
impl UsesTypeParams for ParenthesizedGenericArguments
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for TypeArray
impl UsesTypeParams for TypeArray
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for Binding
impl UsesTypeParams for Binding
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for ReturnType
impl UsesTypeParams for ReturnType
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for Type
impl UsesTypeParams for Type
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for Data
impl UsesTypeParams for Data
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for DataEnum
impl UsesTypeParams for DataEnum
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for DataStruct
impl UsesTypeParams for DataStruct
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for ()
impl UsesTypeParams for ()
fn uses_type_params(
&self,
_options: &Options,
_type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for QSelf
impl UsesTypeParams for QSelf
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for Fields
impl UsesTypeParams for Fields
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for TypePath
impl UsesTypeParams for TypePath
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for TypeImplTrait
impl UsesTypeParams for TypeImplTrait
fn uses_type_params(
&self,
options: &Options,
type_set: &'gen HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'gen Ident, BuildHasherDefault<FnvHasher>>
sourceimpl UsesTypeParams for Ident
impl UsesTypeParams for Ident
Check if an Ident exactly matches one of the sought-after type parameters.