Crate tibba_util

Crate tibba_util 

Source

Structs§

CacheJson
Host
JsonParams
ParsedUri
QueryParams
Stopwatch
A stopwatch structure for measuring elapsed time.

Enums§

Algorithm
An enum to represent supported compression algorithms and their parameters.
Error

Functions§

compress
Compress data using the specified algorithm.
decompress
Decompress data using the specified algorithm.
float_to_fixed
Formats a floating-point number with specified precision
from_timestamp
Converts a Unix timestamp to a formatted local datetime string
generate_device_id_cookie
Generates a new device ID cookie
get_device_id_from_cookie
Retrieves device ID from cookies
get_env
get_header_value
Retrieves a header value as a String
get_map_string
Extracts a string value from a JSON map by key
insert_headers
Inserts multiple HTTP headers into a HeaderMap
is_development
Whether it is a development environment Used to determine whether it is a local development environment
is_production
Whether it is a production environment
is_test
Whether it is a test environment
json_get
Extracts a string value from JSON data by key
json_get_strings
Extracts multiple string values from JSON data by keys
nanoid
Generates a NanoID string of specified length
now
Returns the current local time as a formatted string
parse_uri
read_http_body
Reads and collects an HTTP body into Bytes
set_header_if_not_exist
Sets an HTTP header only if it doesn’t already exist
set_no_cache_if_not_exist
Sets Cache-Control: no-cache header if not already set
sha256
Computes the SHA-256 hash of the input data
sign_hash
Computes the SHA-256 hash of the input data and signs it with the secret key
timestamp
Returns the current Unix timestamp in seconds
timestamp_hash
Computes the SHA-256 hash of the input data and signs it with the secret key
uuid
Generates a UUIDv7 string
validate_sign_hash
Validates the signature of the input data
validate_timestamp_hash
Validates the signature of the input data

Type Aliases§

CacheJsonResult
JsonResult