pub struct Signature {
pub params: Vec<AbiParam>,
pub returns: Vec<AbiParam>,
pub call_conv: CallConv,
}
Expand description
Function signature.
The function signature describes the types of formal parameters and return values along with other details that are needed to call a function correctly.
A signature can optionally include ISA-specific ABI information which specifies exactly how arguments and return values are passed.
Fields§
§params: Vec<AbiParam>
The arguments passed to the function.
returns: Vec<AbiParam>
Values returned from the function.
call_conv: CallConv
Calling convention.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn clear(&mut self, call_conv: CallConv)
pub fn clear(&mut self, call_conv: CallConv)
Clear the signature so it is identical to a fresh one returned by new()
.
Sourcepub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>
pub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>
Find the index of a presumed unique special-purpose parameter.
Sourcepub fn special_return_index(&self, purpose: ArgumentPurpose) -> Option<usize>
pub fn special_return_index(&self, purpose: ArgumentPurpose) -> Option<usize>
Find the index of a presumed unique special-purpose parameter.
Sourcepub fn uses_special_param(&self, purpose: ArgumentPurpose) -> bool
pub fn uses_special_param(&self, purpose: ArgumentPurpose) -> bool
Does this signature have a parameter whose ArgumentPurpose
is
purpose
?
Sourcepub fn uses_special_return(&self, purpose: ArgumentPurpose) -> bool
pub fn uses_special_return(&self, purpose: ArgumentPurpose) -> bool
Does this signature have a return whose ArgumentPurpose
is purpose
?
Sourcepub fn num_special_params(&self) -> usize
pub fn num_special_params(&self) -> usize
How many special parameters does this function have?
Sourcepub fn num_special_returns(&self) -> usize
pub fn num_special_returns(&self) -> usize
How many special returns does this function have?
Sourcepub fn uses_struct_return_param(&self) -> bool
pub fn uses_struct_return_param(&self) -> bool
Does this signature take an struct return pointer parameter?
Sourcepub fn is_multi_return(&self) -> bool
pub fn is_multi_return(&self) -> bool
Does this return more than one normal value? (Pre-struct return legalization)
Trait Implementations§
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
key
and return true
if they are equal.