Skip to main content

Crate copybook_overflow

Crate copybook_overflow 

Source
Expand description

Overflow-safe numeric guards for copybook-rs.

This crate isolates checked arithmetic and checked narrowing conversions that are performance-sensitive and correctness-critical.

All functions return structured copybook_error::Error values with domain-specific error codes on overflow.

Functionsยง

safe_array_bound
Safely calculate COBOL array bounds with overflow protection.
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.