Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

function pointer

A value that points to a named function, written with the type fn(i32) -> i32.

A function pointer (fn type) refers to a function or a closure that captures nothing; it implements all three Fn traits.

Examples

  • let f: fn(i32) -> i32 = double; stores a named function, and let g: fn(i32) -> i32 = |x| x + 1; works too because that closure captures nothing.

Read the full section →