udp 3.1.0

A lightweight and efficient Rust library for building UDP servers with request-response handling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::*;

/// Thread-safe reference-counted read-write lock wrapper.
pub type ArcRwLock<T> = Arc<RwLock<T>>;

/// Helper function to wrap data in an `Arc<RwLock<T>>`.
///
/// # Arguments
///
/// - `T` - The data to wrap.
///
/// # Returns
///
/// - `ArcRwLock<T>` - The wrapped data.
#[inline(always)]
pub fn arc_rwlock<T>(data: T) -> ArcRwLock<T> {
    Arc::new(RwLock::new(data))
}