Struct wasmi::Signature

source ·
pub struct Signature { /* private fields */ }
Expand description

Signature of a function.

Signature of a function consists of zero or more parameter types and zero or one return type.

Two signatures are considered equal if they have equal list of parameters and equal return types.

Implementations§

Creates new signature with givens parameter types and optional return type.

Examples
use wasmi::{Signature, ValueType};

// s1: (i32) -> ()
let s1 = Signature::new(&[ValueType::I32][..], None);

// s2: () -> i32
let s2 = Signature::new(&[][..], Some(ValueType::I32));

// s3: (I64) -> ()
let dynamic_params = vec![ValueType::I64];
let s3 = Signature::new(dynamic_params, None);

Returns parameter types of this signature.

Returns return type of this signature.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.