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
u16with 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
u64tou16with overflow checking. - safe_
u64_ to_ u32 - Safely convert
u64tou32with overflow checking. - safe_
usize_ to_ u32 - Safely convert
usizetou32with 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.