Skip to main content

Module utils

Module utils 

Source

Structs§

SignatureGenerator
A generator for creating cryptographic signatures with support for various key types and configurations.

Functions§

build_client
Builds a reqwest HTTP client with configurable timeout, keep-alive, proxy, and custom agent settings.
build_query_string
Builds a query string from a map of key-value parameters.
build_user_agent
Generates a user agent string for the current module.
build_websocket_api_message
Builds a WebSocket API message with optional authentication and signature generation.
delay
Asynchronously pauses the current task for a specified number of milliseconds.
get_timestamp
Returns the current timestamp in milliseconds since the Unix epoch.
http_request
Sends an HTTP request with retry and error handling capabilities.
normalize_stream_id
Normalizes a stream ID to ensure it is valid, generating a random ID if needed.
parse_rate_limit_headers
Parses rate limit headers from a HashMap of headers and returns a vector of RestApiRateLimit.
random_integer
Generates a cryptographically secure random 32-bit unsigned integer.
random_string
Generates a random hexadecimal string of 32 characters.
remove_empty_value
Removes entries with empty or null values from an iterator of key-value pairs.
replace_websocket_streams_placeholders
Replaces placeholders in a WebSocket stream key with corresponding values from a variables map.
send_request
Sends an HTTP request to a REST API endpoint with optional authentication and configuration.
should_retry_request
Determines whether a request should be retried based on:
sort_object_params
Creates a sorted copy of a BTreeMap of parameters.
validate_time_unit
Validates the time unit string and returns an optional normalized time unit.