pub struct ModuleHelper<'a> {
pub db: &'a dyn SemanticGroup,
pub id: ModuleId,
}
Expand description
Helper for getting functions in the corelib.
Fields§
§db: &'a dyn SemanticGroup
The db.
id: ModuleId
The current module id.
Implementations§
Source§impl<'a> ModuleHelper<'a>
impl<'a> ModuleHelper<'a>
Sourcepub fn core(db: &'a dyn SemanticGroup) -> Self
pub fn core(db: &'a dyn SemanticGroup) -> Self
Returns a helper for the core module.
Sourcepub fn submodule(&self, name: &str) -> Self
pub fn submodule(&self, name: &str) -> Self
Returns a helper for a submodule named name
of the current module.
Sourcepub fn extern_function_id(&self, name: impl Into<SmolStr>) -> ExternFunctionId
pub fn extern_function_id(&self, name: impl Into<SmolStr>) -> ExternFunctionId
Returns the id of an extern function named name
in the current module.
Sourcepub fn trait_id(&self, name: impl Into<SmolStr>) -> TraitId
pub fn trait_id(&self, name: impl Into<SmolStr>) -> TraitId
Returns the id of a trait named name
in the current module.
Sourcepub fn function_id(
&self,
name: impl Into<SmolStr>,
generic_args: Vec<GenericArgumentId>,
) -> FunctionId
pub fn function_id( &self, name: impl Into<SmolStr>, generic_args: Vec<GenericArgumentId>, ) -> FunctionId
Returns the id of a function named name
in the current module, with the given
generic_args
.
Auto Trait Implementations§
impl<'a> Freeze for ModuleHelper<'a>
impl<'a> !RefUnwindSafe for ModuleHelper<'a>
impl<'a> !Send for ModuleHelper<'a>
impl<'a> !Sync for ModuleHelper<'a>
impl<'a> Unpin for ModuleHelper<'a>
impl<'a> !UnwindSafe for ModuleHelper<'a>
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> 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