pub struct FunctionType<'input> { /* private fields */ }Expand description
A function type.
Implementations§
Source§impl<'input> FunctionType<'input>
impl<'input> FunctionType<'input>
Sourcepub fn parameters(&self) -> &[ParameterType<'input>]
pub fn parameters(&self) -> &[ParameterType<'input>]
The parameters of the function.
Sourcepub fn return_type<'a>(
&self,
hash: &'a FileHash<'input>,
) -> Option<Cow<'a, Type<'input>>>
pub fn return_type<'a>( &self, hash: &'a FileHash<'input>, ) -> Option<Cow<'a, Type<'input>>>
The return type of the function.
Sourcepub fn cmp_id(
hash_a: &FileHash<'_>,
a: &FunctionType<'_>,
hash_b: &FileHash<'_>,
b: &FunctionType<'_>,
) -> Ordering
pub fn cmp_id( hash_a: &FileHash<'_>, a: &FunctionType<'_>, hash_b: &FileHash<'_>, b: &FunctionType<'_>, ) -> Ordering
Compare the identifying information of two types.
Function types are considered equal if they have the same parameter types and return types. Parameter names are ignored.
This can be used to sort, and to determine if two types refer to the same definition (even if there are differences in the definitions).
Trait Implementations§
Source§impl<'input> Clone for FunctionType<'input>
impl<'input> Clone for FunctionType<'input>
Source§fn clone(&self) -> FunctionType<'input>
fn clone(&self) -> FunctionType<'input>
Returns a duplicate 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<'input> Debug for FunctionType<'input>
impl<'input> Debug for FunctionType<'input>
Source§impl<'input> Default for FunctionType<'input>
impl<'input> Default for FunctionType<'input>
Source§fn default() -> FunctionType<'input>
fn default() -> FunctionType<'input>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'input> Freeze for FunctionType<'input>
impl<'input> RefUnwindSafe for FunctionType<'input>
impl<'input> Send for FunctionType<'input>
impl<'input> Sync for FunctionType<'input>
impl<'input> Unpin for FunctionType<'input>
impl<'input> UnwindSafe for FunctionType<'input>
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