Struct ra_ap_hir::TypeOrConstParam
source · pub struct TypeOrConstParam { /* private fields */ }
Implementations§
source§impl TypeOrConstParam
impl TypeOrConstParam
pub fn name(self, db: &dyn HirDatabase) -> Name
pub fn module(self, db: &dyn HirDatabase) -> Module
pub fn parent(self, _db: &dyn HirDatabase) -> GenericDef
pub fn split(self, db: &dyn HirDatabase) -> Either<ConstParam, TypeParam>
pub fn ty(self, db: &dyn HirDatabase) -> Type
Trait Implementations§
source§impl Clone for TypeOrConstParam
impl Clone for TypeOrConstParam
source§fn clone(&self) -> TypeOrConstParam
fn clone(&self) -> TypeOrConstParam
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 TypeOrConstParam
impl Debug for TypeOrConstParam
source§impl From<TypeOrConstParam> for TypeOrConstParamId
impl From<TypeOrConstParam> for TypeOrConstParamId
source§fn from(ty: TypeOrConstParam) -> TypeOrConstParamId
fn from(ty: TypeOrConstParam) -> TypeOrConstParamId
Converts to this type from the input type.
source§impl From<TypeOrConstParamId> for TypeOrConstParam
impl From<TypeOrConstParamId> for TypeOrConstParam
source§fn from(id: TypeOrConstParamId) -> TypeOrConstParam
fn from(id: TypeOrConstParamId) -> TypeOrConstParam
Converts to this type from the input type.
source§impl HasSource for TypeOrConstParam
impl HasSource for TypeOrConstParam
type Ast = Either<TypeOrConstParam, 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 Hash for TypeOrConstParam
impl Hash for TypeOrConstParam
source§impl HirDisplay for TypeOrConstParam
impl HirDisplay for TypeOrConstParam
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<TypeOrConstParam> for TypeOrConstParam
impl PartialEq<TypeOrConstParam> for TypeOrConstParam
source§fn eq(&self, other: &TypeOrConstParam) -> bool
fn eq(&self, other: &TypeOrConstParam) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for TypeOrConstParam
impl Eq for TypeOrConstParam
impl StructuralEq for TypeOrConstParam
impl StructuralPartialEq for TypeOrConstParam
Auto Trait Implementations§
impl RefUnwindSafe for TypeOrConstParam
impl Send for TypeOrConstParam
impl Sync for TypeOrConstParam
impl Unpin for TypeOrConstParam
impl UnwindSafe for TypeOrConstParam
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.