Struct Signature
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§
§impl Signature
impl Signature
pub 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()
.
pub 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.
pub 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.
pub 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
?
pub 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
?
pub fn num_special_params(&self) -> usize
pub fn num_special_params(&self) -> usize
How many special parameters does this function have?
pub fn num_special_returns(&self) -> usize
pub fn num_special_returns(&self) -> usize
How many special returns does this function have?
pub fn uses_struct_return_param(&self) -> bool
pub fn uses_struct_return_param(&self) -> bool
Does this signature take an struct return pointer parameter?
pub 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<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Signature, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Signature, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for Signature
impl Serialize for Signature
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.