pub enum GenericFunctionId {
Free(FreeFunctionId),
Extern(ExternFunctionId),
Impl(ImplGenericFunctionId),
}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.
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 unstable_feature(
&self,
db: &dyn SemanticGroup,
) -> Maybe<Option<Attribute>>
pub fn unstable_feature( &self, db: &dyn SemanticGroup, ) -> Maybe<Option<Attribute>>
Returns the attribute if a function has the #[unstable(feature: "some-string")] 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.
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 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§fn eq(&self, other: &GenericFunctionId) -> bool
fn eq(&self, other: &GenericFunctionId) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: SemanticRewriter<FreeFunctionId, Error> + SemanticRewriter<ExternFunctionId, Error> + SemanticRewriter<ImplGenericFunctionId, Error>, Error> SemanticObject<T, Error> for GenericFunctionId
impl<T: SemanticRewriter<FreeFunctionId, Error> + SemanticRewriter<ExternFunctionId, Error> + SemanticRewriter<ImplGenericFunctionId, Error>, Error> SemanticObject<T, Error> for GenericFunctionId
fn default_rewrite(self, rewriter: &mut T) -> Result<Self, Error>
source§impl<'a> SemanticRewriter<GenericFunctionId, DiagnosticAdded> for SubstitutionRewriter<'a>
impl<'a> SemanticRewriter<GenericFunctionId, DiagnosticAdded> for SubstitutionRewriter<'a>
fn rewrite( &mut self, value: GenericFunctionId, ) -> Result<GenericFunctionId, DiagnosticAdded>
source§impl<'a> SemanticRewriter<GenericFunctionId, NoError> for Inference<'a>
impl<'a> SemanticRewriter<GenericFunctionId, NoError> for Inference<'a>
fn rewrite( &mut self, value: GenericFunctionId, ) -> Result<GenericFunctionId, NoError>
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<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<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> 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