pub struct GenericParams {
pub(crate) type_or_consts: Arena<TypeOrConstParamData>,
pub(crate) lifetimes: Arena<LifetimeParamData>,
pub(crate) where_predicates: Box<[WherePredicate]>,
pub(crate) early_bound_lifetimes_len: usize,
}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]>§early_bound_lifetimes_len: usizeImplementations§
Source§impl GenericParams
impl GenericParams
Sourcepub const SELF_PARAM_ID_IN_SELF: Idx<TypeOrConstParamData>
pub const SELF_PARAM_ID_IN_SELF: Idx<TypeOrConstParamData>
The index of the self param in the generic of the non-parent definition.
pub fn empty() -> &'static GenericParams
pub fn of(db: &dyn SourceDatabase, def: GenericDefId) -> &GenericParams
pub fn with_store( db: &dyn SourceDatabase, def: GenericDefId, ) -> (&GenericParams, &ExpressionStore)
pub fn with_source_map( db: &dyn SourceDatabase, def: GenericDefId, ) -> (&GenericParams, &ExpressionStore, &ExpressionStoreSourceMap)
pub fn len_no_late(&self) -> usize
pub fn len_lifetimes(&self) -> usize
pub fn len_early_bound_lifetimes(&self) -> usize
pub fn len_late_bound_lifetimes(&self) -> usize
pub fn len_type_or_consts(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn has_no_predicates(&self) -> bool
pub fn where_predicates(&self) -> &[WherePredicate]
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 iter_early_bound_lt( &self, ) -> impl DoubleEndedIterator<Item = (LocalLifetimeParamId, &LifetimeParamData)>
pub fn iter_late_bound_lt( &self, ) -> impl DoubleEndedIterator<Item = (LocalLifetimeParamId, &LifetimeParamData)>
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 trait_self_param(&self) -> Option<LocalTypeOrConstParamId>
pub fn find_lifetime_by_name( &self, name: &Name, parent: GenericDefId, ) -> Option<LifetimeParamId>
pub fn lifetime_param_idx( &self, lifetime_param_id: &LocalLifetimeParamId, ) -> Option<(usize, bool)>
Trait Implementations§
Source§impl Debug for GenericParams
impl Debug for GenericParams
Source§impl Default for GenericParams
impl Default for GenericParams
Source§fn default() -> GenericParams
fn default() -> GenericParams
Returns the “default value” for a type. Read more
impl Eq for GenericParams
Source§impl Hash for GenericParams
impl Hash for GenericParams
Source§impl Index<Idx<LifetimeParamData>> for GenericParams
impl Index<Idx<LifetimeParamData>> for GenericParams
Source§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
Source§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
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 UnsafeUnpin 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
Compare self to
key and return true if they are equal.§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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more