pub enum GenericFunctionId {
Free(FreeFunctionId),
Extern(ExternFunctionId),
Impl(ImplGenericFunctionId),
Trait(ConcreteTraitGenericFunctionId),
}
Expand description
The ID of a generic function that can be concretized.
Variants§
Free(FreeFunctionId)
A generic free function.
Extern(ExternFunctionId)
A generic extern function.
Impl(ImplGenericFunctionId)
A generic function of an impl.
Trait(ConcreteTraitGenericFunctionId)
Implementations§
Source§impl GenericFunctionId
impl GenericFunctionId
pub fn from_generic_with_body( db: &dyn SemanticGroup, val: GenericFunctionWithBodyId, ) -> Maybe<Self>
pub fn format(&self, db: &dyn SemanticGroup) -> String
pub fn generic_signature(&self, db: &dyn SemanticGroup) -> Maybe<Signature>
pub fn generic_params(&self, db: &dyn SemanticGroup) -> Maybe<Vec<GenericParam>>
pub fn name(&self, db: &dyn SemanticGroup) -> SmolStr
Sourcepub fn module_file_id(&self, db: &dyn SemanticGroup) -> Option<ModuleFileId>
pub fn module_file_id(&self, db: &dyn SemanticGroup) -> Option<ModuleFileId>
Returns the ModuleFileId of the function’s definition if possible.
Sourcepub fn is_must_use(&self, db: &dyn SemanticGroup) -> Maybe<bool>
pub fn is_must_use(&self, db: &dyn SemanticGroup) -> Maybe<bool>
Returns whether the function has the #[must_use]
attribute.
Sourcepub fn is_fully_concrete(&self, db: &dyn SemanticGroup) -> bool
pub fn is_fully_concrete(&self, db: &dyn SemanticGroup) -> bool
Returns true if the function does not depend on any generics.
Sourcepub fn is_var_free(&self, db: &dyn SemanticGroup) -> bool
pub fn is_var_free(&self, db: &dyn SemanticGroup) -> bool
Returns true if the function does not depend on impl or type variables.
Trait Implementations§
Source§impl Clone for GenericFunctionId
impl Clone for GenericFunctionId
Source§fn clone(&self) -> GenericFunctionId
fn clone(&self) -> GenericFunctionId
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 GenericFunctionId
impl Debug for GenericFunctionId
Source§impl DebugWithDb<dyn SemanticGroup> for GenericFunctionId
impl DebugWithDb<dyn SemanticGroup> for GenericFunctionId
Source§impl Hash for GenericFunctionId
impl Hash for GenericFunctionId
Source§impl OptionFrom<ModuleItemId> for GenericFunctionId
impl OptionFrom<ModuleItemId> for GenericFunctionId
Conversion from ModuleItemId to GenericFunctionId.
fn option_from(item: ModuleItemId) -> Option<Self>
Source§impl PartialEq for GenericFunctionId
impl PartialEq for GenericFunctionId
Source§impl<T: SemanticRewriter<FreeFunctionId, Error> + SemanticRewriter<ExternFunctionId, Error> + SemanticRewriter<ImplGenericFunctionId, Error> + SemanticRewriter<ConcreteTraitGenericFunctionId, Error>, Error> SemanticObject<T, Error> for GenericFunctionId
impl<T: SemanticRewriter<FreeFunctionId, Error> + SemanticRewriter<ExternFunctionId, Error> + SemanticRewriter<ImplGenericFunctionId, Error> + SemanticRewriter<ConcreteTraitGenericFunctionId, Error>, Error> SemanticObject<T, Error> for GenericFunctionId
fn default_rewrite(&mut self, rewriter: &mut T) -> Result<RewriteResult, Error>
Source§impl<'a> SemanticRewriter<GenericFunctionId, DiagnosticAdded> for SubstitutionRewriter<'a>
impl<'a> SemanticRewriter<GenericFunctionId, DiagnosticAdded> for SubstitutionRewriter<'a>
fn internal_rewrite( &mut self, value: &mut GenericFunctionId, ) -> Maybe<RewriteResult>
fn rewrite(&mut self, value: T) -> Result<T, Error>
Source§impl<'a> SemanticRewriter<GenericFunctionId, NoError> for Inference<'a>
impl<'a> SemanticRewriter<GenericFunctionId, NoError> for Inference<'a>
fn internal_rewrite( &mut self, value: &mut GenericFunctionId, ) -> Result<RewriteResult, NoError>
fn rewrite(&mut self, value: T) -> Result<T, Error>
impl Copy for GenericFunctionId
impl Eq for GenericFunctionId
impl StructuralPartialEq for GenericFunctionId
Auto Trait Implementations§
impl Freeze for GenericFunctionId
impl RefUnwindSafe for GenericFunctionId
impl Send for GenericFunctionId
impl Sync for GenericFunctionId
impl Unpin for GenericFunctionId
impl UnwindSafe for GenericFunctionId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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