Carrier negotiation + WebSocket lifecycle

Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
Alexey
2026-08-27 07:38:42 +03:00
parent 80a2737eed
commit c75cf5cc9d
28 changed files with 1411 additions and 1320 deletions
+10
View File
@@ -77,6 +77,11 @@ impl CarrierCapabilities {
Self(0b1111)
}
/// Returns the current server-authoritative native iOS capability ceiling.
pub(crate) const fn ios() -> Self {
Self(1 << WebCarrier::Https.index())
}
/// Builds a set from a validated bit representation.
pub(crate) const fn from_bits(bits: u8) -> Option<Self> {
if bits != 0 && bits & !0b1111 == 0 {
@@ -90,6 +95,11 @@ impl CarrierCapabilities {
pub(crate) const fn contains(self, carrier: WebCarrier) -> bool {
self.0 & (1 << carrier.index()) != 0
}
/// Intersects declared capabilities with an authoritative server ceiling.
pub(crate) const fn intersection(self, ceiling: Self) -> Option<Self> {
Self::from_bits(self.0 & ceiling.0)
}
}
/// Immutable metadata attached to one session-creation attempt.