Crate rmqtt_utils

Source
Expand description

Overall usage example:

use rmqtt_utils::{
    Bytesize, NodeAddr,
    to_bytesize, to_duration,
    timestamp_secs, format_timestamp_now
};

// Parse byte size from string
let size = Bytesize::from("2G512M");

// Convert duration string
let duration = to_duration("1h30m15s");

// Parse node address
let node: NodeAddr = "123@127.0.0.1:1883".parse().unwrap();

// Get formatted timestamp
let now = format_timestamp_now();

Structs§

Bytesize
Human-readable byte size representation with parsing/serialization support
Counter
A counter with current and maximum tracking, and optional merging behavior.
NodeAddr
Cluster node address representation (ID@Address)

Enums§

StatsMergeMode
Merge behavior modes for Counter.

Functions§

deserialize_addr
Deserialize SocketAddr with error handling
deserialize_addr_option
Deserialize optional SocketAddr with port handling
deserialize_datetime_option
Deserialize optional datetime from string
deserialize_duration
Deserialize Duration from human-readable string format
deserialize_duration_option
Deserialize optional Duration from string
format_timestamp
Format timestamp (seconds) to human-readable string
format_timestamp_millis
Format millisecond timestamp to string
format_timestamp_millis_now
Format current millisecond timestamp to string
format_timestamp_now
Format current timestamp to string
serialize_datetime_option
Serialize optional datetime to string
timestamp
Get current timestamp as Duration
timestamp_millis
Get current timestamp in milliseconds
timestamp_secs
Get current timestamp in seconds
to_bytesize
Parse human-readable byte size string to usize
to_duration
Convert human-readable duration string to Duration

Type Aliases§

Addr
Network address storage using efficient ByteString
NodeId
Cluster node identifier type (64-bit unsigned integer)
Timestamp
Timestamp representation in seconds since Unix epoch
TimestampMillis
Timestamp representation in milliseconds since Unix epoch