1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/// Pre-concatenated point-to-point key prefix including the trailing separator hyphen.
pub const POINT_TO_POINT_PREFIX: &str = "ptp--";
/// Pre-concatenated point-to-group key prefix including the trailing separator hyphen.
pub const POINT_TO_GROUP_PREFIX: &str = "ptg--";
/// Stack buffer capacity in bytes for formatting broadcast room keys without heap allocation.
pub const STACK_KEY_BUF_LEN: usize = 64;
/// ASCII hyphen separator byte used in broadcast keys and negative integers.
pub const BYTE_DASH: u8 = b'-';
/// ASCII zero digit byte.
pub const BYTE_ZERO: u8 = b'0';
/// Lowercase ASCII representation of `true`.
pub const BOOL_TRUE_BYTES: & = b"true";
/// Lowercase ASCII representation of `false`.
pub const BOOL_FALSE_BYTES: & = b"false";
/// Two-digit ASCII decimal lookup pairs for `00..=99`.
pub const DEC_DIGITS_LUT: & = b"00010203040506070809\
10111213141516171819\
20212223242526272829\
30313233343536373839\
40414243444546474849\
50515253545556575859\
60616263646566676869\
70717273747576777879\
80818283848586878889\
90919293949596979899";
/// Maximum coalesced broadcast frame bytes accumulated per single stream write.
pub const WS_COALESCE_MAX_BYTES: usize = 64 * 1024;
/// Maximum reusable heap buffer capacity retained in the worker-local coalesce scratch pool.
pub const WS_FRAME_BUF_MAX_RETAIN: usize = 64 * 1024;
/// Maximum number of reusable frame coalesce buffers cached per worker thread.
pub const WS_MAX_POOLED_COALESCE_BUFS: usize = 16;
/// Stack buffer capacity in bytes for single-allocation server WebSocket frame encoding.
pub const WS_FRAME_STACK_CAP: usize = 512;
/// Number of cache-line-aligned room shards in [`SparseWsHub`].
pub const WS_SHARD_COUNT: usize = 64;
/// Multiplicative 64-bit mixing constant for zero-allocation [`WsKeyHasher`].
pub const WS_FX_HASH_K: u64 = 0x517c_c1b7_2722_0a95;
/// Prebuilt RFC 6455 empty final text frame (`FIN=1, opcode=Text, len=0`).
pub const WS_EMPTY_TEXT_FRAME: = ;
/// RFC 6455 `FIN` bit flag (`0x80`).
pub const WS_FIN_BIT: u8 = 0x80;
/// RFC 6455 continuation frame opcode (`0x00`).
pub const WS_OPCODE_CONTINUATION: u8 = 0x00;
/// RFC 6455 text frame opcode (`0x01`).
pub const WS_OPCODE_TEXT: u8 = 0x01;
/// RFC 6455 binary frame opcode (`0x02`).
pub const WS_OPCODE_BINARY: u8 = 0x02;
/// RFC 6455 UTF-8 continuation byte mask (`0xC0`).
pub const WS_UTF8_CONT_MASK: u8 = 0xC0;
/// RFC 6455 UTF-8 continuation byte prefix (`0x80`).
pub const WS_UTF8_CONT_PREFIX: u8 = 0x80;
/// RFC 6455 extended 16-bit payload length marker (`126`).
pub const WS_LEN_EXT16: u8 = 126;
/// RFC 6455 extended 64-bit payload length marker (`127`).
pub const WS_LEN_EXT64: u8 = 127;
/// Maximum single-byte RFC 6455 payload length threshold (`126`).
pub const WS_LEN_SHORT_LIMIT: usize = 126;
/// RFC 6455 non-final frame flag (`0x00`).
pub const WS_NON_FIN_BIT: u8 = 0x00;
/// Field label rendered by `Debug` for [`WebSocket::broadcast_map`].
pub const WS_DEBUG_STRUCT_NAME: &str = "WebSocket";
/// Field name rendered by `Debug` for [`WebSocket::broadcast_map`].
pub const WS_DEBUG_BROADCAST_FIELD: &str = "broadcast_map";
/// Field name rendered by `Debug` for active sparse WebSocket rooms.
pub const WS_DEBUG_SPARSE_ROOMS_FIELD: &str = "sparse_rooms";