Crate udp

Source
Expand description

udp

A lightweight and efficient Rust library for building UDP servers with request-response handling.

Re-exports§

pub use tokio;

Structs§

ArcRwLockUdpSocket
Thread-safe wrapper for UDP socket with read-write lock.
Context
Thread-safe context wrapper for UDP operations.
InnerContext
Inner context containing all UDP communication components.
Response
UDP response wrapper containing response data.
Server
UDP server instance containing configuration and handler functions.

Enums§

ResponseError
Error types for response operations.
ServerError
Error types for server operations.

Constants§

COLON_SPACE
COLON_SPACE_SYMBOL
DEFAULT_BUFFER_SIZE
DEFAULT_HOST
DEFAULT_INNER_LOG
DEFAULT_INNER_PRINT
DEFAULT_LISTEN_PORT

Functions§

get_thread_count
Gets the number of available threads for parallel processing.
remove_trailing_zeros
Removes trailing zeros from a byte vector.

Type Aliases§

ArcAnySendSync
ArcMutexGuardUdpSocket
Thread-safe reference-counted mutex guard for UDP socket.
ArcRwLockWriteGuardUdpSocket
Thread-safe reference-counted write guard for UDP socket.
ArcUdpSocket
Thread-safe reference-counted UDP socket.
HashMapArcAnySendSync
OptionArcMutexGuardUdpSocket
Optional thread-safe reference-counted mutex guard for UDP socket.
OptionArcRwLockUdpSocket
Optional thread-safe read-write locked UDP socket.
OptionArcRwLockWriteGuardUdpSocket
Optional thread-safe reference-counted write guard for UDP socket.
OptionArcUdpSocket
Optional thread-safe reference-counted UDP socket.
OptionSocketAddr
Optional socket address (IP + port).
OptionSocketHost
Optional socket host IP address.
OptionSocketPort
Optional socket port number.
Request
ResponseData
Type alias for raw response data (byte vector).
ResponseResult
Result type for response operations.
RwLockReadContext
RwLockReadGuardUdpSocket
Read guard for read-write locked UDP socket.
RwLockWriteContext
RwLockWriteGuardUdpSocket
Write guard for read-write locked UDP socket.