kafka-client-engine 0.0.1

Execution and driver-integration layer for the native Kafka client
Documentation
1
2
3
4
5
6
7
8
//! Checked conversion of `ListOffsets` throttle milliseconds into core ticks.

const NANOSECONDS_PER_MILLISECOND: u64 = 1_000_000;

/// Converts Kafka's nonnegative millisecond throttle into core nanosecond ticks.
pub(crate) fn throttle_ticks(throttle_time_ms: u32) -> Option<u64> {
    u64::from(throttle_time_ms).checked_mul(NANOSECONDS_PER_MILLISECOND)
}