Skip to main content

function

Function function 

Source
pub fn function(
    name: &str,
    parameters: Vec<GeneratedToken>,
    result: Vec<GeneratedToken>,
    body: Vec<GeneratedToken>,
) -> Result<Vec<GeneratedToken>, Overflow>
Expand description

One item fn name(parameters) -> result { body }.

The visibility is the caller’s and is written before this, so one helper spells a private function, a pub one, and a pub(crate) one.

§Errors

Returns Overflow where the parameter list or the body outgrows the declared magnitude.