Skip to main content

Crate copybook_safe_ops

Crate copybook_safe_ops 

Source
Expand description

Panic-safe conversion and arithmetic helper functions.

This crate centralizes arithmetic-focused helpers and re-exports text-oriented panic-safe operations from copybook_safe_text.

Functions§

parse_isize
Safely convert a string to isize, returning an error on failure.
parse_usize
Safely convert a string to usize, returning an error on failure.
safe_array_bound
Safely calculate COBOL array bounds with overflow protection.
safe_divide
Safely divide two numbers, checking for division by zero.
safe_parse_u16
Safely convert u16 with parse error handling.
safe_slice_get
Access a slice index with explicit bounds checking.
safe_string_char_at
Safely access a string character with bounds checking.
safe_u64_to_u16
Safely convert u64 to u16 with overflow checking.
safe_u64_to_u32
Safely convert u64 to u32 with overflow checking.
safe_usize_to_u32
Safely convert usize to u32 with overflow checking.
safe_write
Safely format data into a string buffer for JSON generation.
safe_write_str
Safely append a string slice to a buffer for JSON field construction.

Type Aliases§

Result
Result type alias using copybook-error.