Skip to main content

Module helpers

Module helpers 

Source
Expand description

Common argument extraction helpers for stdlib module functions.

These reduce boilerplate in module implementations by centralising argument-count validation and typed argument extraction with uniform error messages.

Traits§

StringResultExt
Extension trait that adds .with_context() to Result<T, String>.

Functions§

check_arg_count
Validate that args has exactly expected elements.
contextualize
Format a contextualized error string.
extract_bool_arg
Extract a bool argument at index from args.
extract_float_arg
Extract an f64 argument at index from args.
extract_number_arg
Extract a numeric (i64) argument at index from args.
extract_string_arg
Extract a string argument at index from args.