pub struct Signature {
pub params: Vec<Type>,
pub returns: Vec<Type>,
pub variadic: bool,
}Expand description
What a function takes and returns.
A signature is not a type. Nothing in the IR has a function type, because a ptr has no
pointee and there is nothing else a function type could sit on. A call_indirect names the
signature it is called with, and that is where the ABI attributes are read from.
Fields§
§params: Vec<Type>What it takes, in their C-level form before the ABI has been applied.
returns: Vec<Type>What it returns, which is empty for a void function.
variadic: boolWhether it takes arguments beyond the ones named.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn with_params(self, params: &[Type]) -> Self
pub fn with_params(self, params: &[Type]) -> Self
The same signature with these parameters.
Sourcepub fn with_returns(self, returns: &[Type]) -> Self
pub fn with_returns(self, returns: &[Type]) -> Self
The same signature returning these.
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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more