Struct hir_def::generics::GenericParams
source · pub struct GenericParams {
pub type_or_consts: Arena<TypeOrConstParamData>,
pub lifetimes: Arena<LifetimeParamData>,
pub where_predicates: Box<[WherePredicate]>,
}
Expand description
Data about the generic parameters of a function, struct, impl, etc.
Fields§
§type_or_consts: Arena<TypeOrConstParamData>
§lifetimes: Arena<LifetimeParamData>
§where_predicates: Box<[WherePredicate]>
Implementations§
source§impl GenericParams
impl GenericParams
pub fn is_empty(&self) -> bool
sourcepub fn iter_type_or_consts(
&self
) -> impl DoubleEndedIterator<Item = (LocalTypeOrConstParamId, &TypeOrConstParamData)>
pub fn iter_type_or_consts( &self ) -> impl DoubleEndedIterator<Item = (LocalTypeOrConstParamId, &TypeOrConstParamData)>
Iterator of type_or_consts field
sourcepub fn iter_lt(
&self
) -> impl DoubleEndedIterator<Item = (LocalLifetimeParamId, &LifetimeParamData)>
pub fn iter_lt( &self ) -> impl DoubleEndedIterator<Item = (LocalLifetimeParamId, &LifetimeParamData)>
Iterator of lifetimes field
pub fn find_type_by_name( &self, name: &Name, parent: GenericDefId ) -> Option<TypeParamId>
pub fn find_const_by_name( &self, name: &Name, parent: GenericDefId ) -> Option<ConstParamId>
pub fn find_trait_self_param(&self) -> Option<LocalTypeOrConstParamId>
pub fn find_lifetime_by_name( &self, name: &Name, parent: GenericDefId ) -> Option<LifetimeParamId>
Trait Implementations§
source§impl Clone for GenericParams
impl Clone for GenericParams
source§fn clone(&self) -> GenericParams
fn clone(&self) -> GenericParams
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GenericParams
impl Debug for GenericParams
source§impl Hash for GenericParams
impl Hash for GenericParams
source§impl Index<Idx<LifetimeParamData>> for GenericParams
impl Index<Idx<LifetimeParamData>> for GenericParams
§type Output = LifetimeParamData
type Output = LifetimeParamData
The returned type after indexing.
source§fn index(&self, index: LocalLifetimeParamId) -> &LifetimeParamData
fn index(&self, index: LocalLifetimeParamId) -> &LifetimeParamData
Performs the indexing (
container[index]
) operation. Read moresource§impl Index<Idx<TypeOrConstParamData>> for GenericParams
impl Index<Idx<TypeOrConstParamData>> for GenericParams
§type Output = TypeOrConstParamData
type Output = TypeOrConstParamData
The returned type after indexing.
source§fn index(&self, index: LocalTypeOrConstParamId) -> &TypeOrConstParamData
fn index(&self, index: LocalTypeOrConstParamId) -> &TypeOrConstParamData
Performs the indexing (
container[index]
) operation. Read moresource§impl PartialEq for GenericParams
impl PartialEq for GenericParams
source§fn eq(&self, other: &GenericParams) -> bool
fn eq(&self, other: &GenericParams) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for GenericParams
impl StructuralPartialEq for GenericParams
Auto Trait Implementations§
impl Freeze for GenericParams
impl RefUnwindSafe for GenericParams
impl Send for GenericParams
impl Sync for GenericParams
impl Unpin for GenericParams
impl UnwindSafe for GenericParams
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.