Struct ra_ap_hir_ty::CallableSig
source · pub struct CallableSig { /* private fields */ }
Expand description
A function signature as seen by type inference: Several parameter types and one return type.
Implementations§
source§impl CallableSig
impl CallableSig
pub fn from_params_and_return( params: Vec<Ty>, ret: Ty, is_varargs: bool, safety: Safety, abi: FnAbi ) -> CallableSig
pub fn from_def( db: &dyn HirDatabase, def: FnDefId, substs: &Substitution ) -> CallableSig
pub fn from_fn_ptr(fn_ptr: &FnPointer) -> CallableSig
pub fn to_fn_ptr(&self) -> FnPointer
pub fn params(&self) -> &[Ty]
pub fn ret(&self) -> &Ty
Trait Implementations§
source§impl Clone for CallableSig
impl Clone for CallableSig
source§fn clone(&self) -> CallableSig
fn clone(&self) -> CallableSig
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 CallableSig
impl Debug for CallableSig
source§impl HasInterner for CallableSig
impl HasInterner for CallableSig
source§impl HirDisplay for CallableSig
impl HirDisplay for CallableSig
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 CallableSig
impl PartialEq for CallableSig
source§fn eq(&self, other: &CallableSig) -> bool
fn eq(&self, other: &CallableSig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TypeFoldable<Interner> for CallableSig
impl TypeFoldable<Interner> for CallableSig
source§fn try_fold_with<E>(
self,
folder: &mut dyn FallibleTypeFolder<Interner, Error = E>,
outer_binder: DebruijnIndex
) -> Result<Self, E>
fn try_fold_with<E>( self, folder: &mut dyn FallibleTypeFolder<Interner, Error = E>, outer_binder: DebruijnIndex ) -> Result<Self, E>
Apply the given folder
folder
to self
; binders
is the
number of binders that are in scope when beginning the
folder. Typically binders
starts as 0, but is adjusted when
we encounter Binders<T>
in the IR or other similar
constructs.source§fn fold_with(
self,
folder: &mut dyn TypeFolder<I, Error = Infallible>,
outer_binder: DebruijnIndex
) -> Self
fn fold_with( self, folder: &mut dyn TypeFolder<I, Error = Infallible>, outer_binder: DebruijnIndex ) -> Self
A convenient alternative to
try_fold_with
for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with
.impl Eq for CallableSig
impl StructuralPartialEq for CallableSig
Auto Trait Implementations§
impl Freeze for CallableSig
impl RefUnwindSafe for CallableSig
impl Send for CallableSig
impl Sync for CallableSig
impl Unpin for CallableSig
impl UnwindSafe for CallableSig
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.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, I> Shift<I> for Twhere
T: TypeFoldable<I>,
I: Interner,
impl<T, I> Shift<I> for Twhere
T: TypeFoldable<I>,
I: Interner,
source§fn shifted_in(self, interner: I) -> T
fn shifted_in(self, interner: I) -> T
Shifts this term in one level of binders.
source§fn shifted_in_from(self, interner: I, source_binder: DebruijnIndex) -> T
fn shifted_in_from(self, interner: I, source_binder: DebruijnIndex) -> T
Shifts a term valid at
outer_binder
so that it is
valid at the innermost binder. See DebruijnIndex::shifted_in_from
for a detailed explanation.source§fn shifted_out_to(
self,
interner: I,
target_binder: DebruijnIndex
) -> Result<T, NoSolution>
fn shifted_out_to( self, interner: I, target_binder: DebruijnIndex ) -> Result<T, NoSolution>
Shifts a term valid at the innermost binder so that it is
valid at
outer_binder
. See DebruijnIndex::shifted_out_to
for a detailed explanation.source§fn shifted_out(self, interner: I) -> Result<T, NoSolution>
fn shifted_out(self, interner: I) -> Result<T, NoSolution>
Shifts this term out one level of binders.