Expand description
In-memory rendezvous session exchange.
The service holds short-lived client rendezvous payloads, conditional validators, recorded transactions, and per-client rate-limit buckets. Sessions are bounded in count and intentionally disappear on restart.
Re-exportsยง
use std::cmp::max;๐use std::collections::BTreeMap;๐use std::collections::HashMap;๐use std::collections::VecDeque;๐use std::net::IpAddr;๐use std::str;๐use std::sync::Arc;๐use std::sync::Mutex;๐use std::sync::RwLock;๐use std::time::Duration;๐use std::time::Instant;๐use std::time::SystemTime;๐use std::time::UNIX_EPOCH;๐use base64::Engine as _;๐use base64::engine::general_purpose::URL_SAFE_NO_PAD as b64;๐use bytes::Bytes;๐use http::StatusCode;๐use ruma::OwnedTransactionId;๐use ruma::TransactionId;๐use ruma::api::error::ErrorKind;๐use ruma::api::error::LimitExceededErrorData;๐use tuwunel_core::Error;๐use tuwunel_core::Result;๐use tuwunel_core::arrayvec::ArrayString;๐use tuwunel_core::implement;๐use tuwunel_core::utils::hash::sha256::concat;๐use tuwunel_core::utils::rand::string_array;๐use tuwunel_core::utils::time::duration_since_epoch;๐
Structsยง
- Attempt
- A single send attempt under a sequence token.
- Meta
- HTTP metadata associated with a rendezvous payload.
- Service
- Stores bounded rendezvous sessions and request rate-limit state.
- Session ๐
- Complete process-local state for one rendezvous session.
Enumsยง
- Get
- Outcome of retrieving a rendezvous session.
- Put
- Outcome of conditionally replacing a rendezvous payload.
Constantsยง
- ETAG_
LENGTH ๐ - ETAG_
VALUE_ ๐LENGTH - MAX_
HTTP_ ๐DATE_ SECONDS - MAX_
TRANSACTIONS ๐ - MILLIS_
PER_ ๐SECOND - MONOTONIC_
STEP ๐ - RATELIMIT_
MAP_ ๐CAP - SESSION_
ID_ ๐LENGTH
Functionsยง
- check_
bucket_ ๐at - etag ๐
- etag_
matches ๐ - etag_
value ๐ - expires_
at ๐ - get_
outcome ๐ - next_
last_ ๐modified
Type Aliasesยง
- Etag
- Quoted HTTP entity tag for rendezvous payload state.
- Ratelimiter ๐
- Session
Id - Fixed-capacity identifier for a rendezvous session.
- Sessions ๐
- Transactions ๐