The proper function of man is to live, not to exist.
— Jack London
Functions
NAME wyzer-functions - Function definitions and FFI bindings
DESCRIPTION
Wyzer functions require explicit type signatures for parameters and returns. External functions can be bound using the extern keyword.
SYNOPSIS: DEFINITION
pub fn multiply(a: u32, b: u32) -> u32 {
a * b
}
fn main() {
let result = multiply(5, 10);
}
FUNCTION DETAILS
pub: Exposes the function to other modules. Functions are private by default.(a: u32, b: u32): Typed parameter list.-> u32: Return type annotation.- Implicit Return: The final expression in a block (without a semicolon) is returned.
SYNOPSIS: EXTERNAL (FFI)
extern "C" fn malloc(size: usize) -> *u8;
FFI DETAILS
extern "C": Binds a function using the C Application Binary Interface (ABI).*u8: Raw pointer type.