shardline-server 1.0.0

HTTP server boundary, runtime, and operator workflows for Shardline.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::ServerError;

pub(crate) const fn checked_add(left: u64, right: u64) -> Result<u64, ServerError> {
    match left.checked_add(right) {
        Some(value) => Ok(value),
        None => Err(ServerError::Overflow),
    }
}

pub(crate) const fn checked_increment(value: u64) -> Result<u64, ServerError> {
    checked_add(value, 1)
}