pub struct Trait { /* private fields */ }
Implementations§
source§impl Trait
impl Trait
pub fn lang(db: &dyn HirDatabase, krate: Crate, name: &Name) -> Option<Trait>
pub fn module(self, db: &dyn HirDatabase) -> Module
pub fn name(self, db: &dyn HirDatabase) -> Name
pub fn items(self, db: &dyn HirDatabase) -> Vec<AssocItem>
pub fn items_with_supertraits(self, db: &dyn HirDatabase) -> Vec<AssocItem>
pub fn is_auto(self, db: &dyn HirDatabase) -> bool
pub fn is_unsafe(&self, db: &dyn HirDatabase) -> bool
pub fn type_or_const_param_count(
&self,
db: &dyn HirDatabase,
count_required_only: bool
) -> usize
Trait Implementations§
source§impl From<Trait> for GenericDef
impl From<Trait> for GenericDef
source§fn from(it: Trait) -> GenericDef
fn from(it: Trait) -> GenericDef
Converts to this type from the input type.
source§impl HasAttrs for Trait
impl HasAttrs for Trait
fn attrs(self, db: &dyn HirDatabase) -> AttrsWithOwner
fn docs(self, db: &dyn HirDatabase) -> Option<Documentation>
fn resolve_doc_path(
self,
db: &dyn HirDatabase,
link: &str,
ns: Option<Namespace>
) -> Option<ModuleDef>
source§impl HasSource for Trait
impl HasSource for Trait
type Ast = Trait
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.source§impl HasVisibility for Trait
impl HasVisibility for Trait
fn visibility(&self, db: &dyn HirDatabase) -> Visibility
fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool
source§impl HirDisplay for Trait
impl HirDisplay for Trait
fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>
source§fn into_displayable<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn into_displayable<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> 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 + 'a)
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> 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 + 'a),
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display_truncated<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a),
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_source_code<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a),
module_id: ModuleId
) -> Result<String, DisplaySourceCodeError>
fn display_source_code<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a),
module_id: ModuleId
) -> 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 + 'a)
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
fn display_test<'a>(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self>where
Self: Sized,
Returns a String representation of
self
for test purposessource§impl PartialEq<Trait> for Trait
impl PartialEq<Trait> for Trait
impl Copy for Trait
impl Eq for Trait
impl StructuralEq for Trait
impl StructuralPartialEq for Trait
Auto Trait Implementations§
impl RefUnwindSafe for Trait
impl Send for Trait
impl Sync for Trait
impl Unpin for Trait
impl UnwindSafe for Trait
Blanket Implementations§
§impl<T> Cast for T
impl<T> Cast for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.