pub struct ModuleHelper<'a> {
pub db: &'a dyn Database,
pub id: ModuleId<'a>,
}Expand description
Helper for getting functions in the corelib.
Fields§
§db: &'a dyn DatabaseThe db.
id: ModuleId<'a>The current module id.
Implementations§
Source§impl<'a> ModuleHelper<'a>
impl<'a> ModuleHelper<'a>
Sourcepub fn submodule(&self, name: &'a str) -> Self
pub fn submodule(&self, name: &'a str) -> Self
Returns a helper for a submodule named name of the current module.
Sourcepub fn extern_function_id(&self, name: &str) -> ExternFunctionId<'a>
pub fn extern_function_id(&self, name: &str) -> ExternFunctionId<'a>
Returns the id of an extern function named name in the current module.
Sourcepub fn trait_id(&self, name: &'a str) -> TraitId<'a>
pub fn trait_id(&self, name: &'a str) -> TraitId<'a>
Returns the id of a trait named name in the current module.
Sourcepub fn free_function_id(&self, name: &'a str) -> FreeFunctionId<'a>
pub fn free_function_id(&self, name: &'a str) -> FreeFunctionId<'a>
Returns the id of a free function named name in the current module.
Sourcepub fn function_id(
&self,
name: &'a str,
generic_args: Vec<GenericArgumentId<'a>>,
) -> FunctionId<'a>
pub fn function_id( &self, name: &'a str, generic_args: Vec<GenericArgumentId<'a>>, ) -> FunctionId<'a>
Returns the id of a function named name in the current module, with the given
generic_args.
Sourcepub fn generic_function_id(&self, name: &'a str) -> GenericFunctionId<'a>
pub fn generic_function_id(&self, name: &'a str) -> GenericFunctionId<'a>
Returns the id of a generic function named name in the current module.
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<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
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