Struct ra_ap_hir::ExternCrateDecl
source · pub struct ExternCrateDecl { /* private fields */ }
Implementations§
source§impl ExternCrateDecl
impl ExternCrateDecl
pub fn module(self, db: &dyn HirDatabase) -> Module
pub fn resolved_crate(self, db: &dyn HirDatabase) -> Option<Crate>
pub fn name(self, db: &dyn HirDatabase) -> Name
pub fn alias(self, db: &dyn HirDatabase) -> Option<ImportAlias>
sourcepub fn alias_or_name(self, db: &dyn HirDatabase) -> Option<Name>
pub fn alias_or_name(self, db: &dyn HirDatabase) -> Option<Name>
Returns the name under which this crate is made accessible, taking _
into account.
Trait Implementations§
source§impl Clone for ExternCrateDecl
impl Clone for ExternCrateDecl
source§fn clone(&self) -> ExternCrateDecl
fn clone(&self) -> ExternCrateDecl
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 ExternCrateDecl
impl Debug for ExternCrateDecl
source§impl From<ExternCrateDecl> for ExternCrateId
impl From<ExternCrateDecl> for ExternCrateId
source§fn from(ty: ExternCrateDecl) -> ExternCrateId
fn from(ty: ExternCrateDecl) -> ExternCrateId
Converts to this type from the input type.
source§impl From<ExternCrateId> for ExternCrateDecl
impl From<ExternCrateId> for ExternCrateDecl
source§fn from(id: ExternCrateId) -> ExternCrateDecl
fn from(id: ExternCrateId) -> ExternCrateDecl
Converts to this type from the input type.
source§impl HasAttrs for ExternCrateDecl
impl HasAttrs for ExternCrateDecl
fn attrs(self, db: &dyn HirDatabase) -> AttrsWithOwner
source§impl HasContainer for ExternCrateDecl
impl HasContainer for ExternCrateDecl
fn container(&self, db: &dyn HirDatabase) -> ItemContainer
source§impl HasSource for ExternCrateDecl
impl HasSource for ExternCrateDecl
type Ast = ExternCrate
source§fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>
Fetches the definition’s source node.
Using [
crate::Semantics::source
] is preferred when working with crate::Semantics
,
as that caches the parsed file in the semantics’ cache. Read moresource§impl HasVisibility for ExternCrateDecl
impl HasVisibility for ExternCrateDecl
fn visibility(&self, db: &dyn HirDatabase) -> Visibility
fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool
source§impl Hash for ExternCrateDecl
impl Hash for ExternCrateDecl
source§impl HirDisplay for ExternCrateDecl
impl HirDisplay for ExternCrateDecl
fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>
source§fn into_displayable<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>,
limited_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget,
closure_style: ClosureStyle
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn into_displayable<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>,
limited_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget,
closure_style: ClosureStyle
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
Returns a
Display
able type that is human-readable.source§fn display<'a>(&'a self, db: &'a dyn HirDatabase) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display<'a>(&'a self, db: &'a dyn HirDatabase) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
Returns a
Display
able type that is human-readable.
Use this for showing types to the user (e.g. diagnostics)source§fn display_truncated<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display_truncated<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
Returns a
Display
able type that is human-readable and tries to be succinct.
Use this for showing types to the user where space is constrained (e.g. doc popups)source§fn display_limited<'a>(
&'a self,
db: &'a dyn HirDatabase,
limited_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display_limited<'a>(
&'a self,
db: &'a dyn HirDatabase,
limited_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
Returns a
Display
able type that is human-readable and tries to limit the number of items inside.
Use this for showing definitions which may contain too many items, like trait
, struct
, enum
source§fn display_source_code<'a>(
&'a self,
db: &'a dyn HirDatabase,
module_id: ModuleId,
allow_opaque: bool
) -> Result<String, DisplaySourceCodeError>
fn display_source_code<'a>( &'a self, db: &'a dyn HirDatabase, module_id: ModuleId, allow_opaque: bool ) -> Result<String, DisplaySourceCodeError>
Returns a String representation of
self
that can be inserted into the given module.
Use this when generating code (e.g. assists)source§fn display_test<'a>(
&'a self,
db: &'a dyn HirDatabase
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display_test<'a>(
&'a self,
db: &'a dyn HirDatabase
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
Returns a String representation of
self
for test purposessource§impl PartialEq for ExternCrateDecl
impl PartialEq for ExternCrateDecl
source§fn eq(&self, other: &ExternCrateDecl) -> bool
fn eq(&self, other: &ExternCrateDecl) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ExternCrateDecl
impl Eq for ExternCrateDecl
impl StructuralPartialEq for ExternCrateDecl
Auto Trait Implementations§
impl Freeze for ExternCrateDecl
impl RefUnwindSafe for ExternCrateDecl
impl Send for ExternCrateDecl
impl Sync for ExternCrateDecl
impl Unpin for ExternCrateDecl
impl UnwindSafe for ExternCrateDecl
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> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.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.