pub struct ServerState {
pub players: DashMap<String, ConnectedPlayer>,
pub rooms: DashMap<String, Room>,
pub server_key: String,
pub max_rooms: usize,
pub official_key: Option<String>,
pub analytics: AnalyticsHandle,
pub identity: IdentityVerifier,
pub direct_transport: bool,
pub ice_servers: Vec<IceServer>,
pub lobby_chat: Mutex<ChatHistory>,
pub seal: Option<MessageSealer>,
pub art_base_url: Option<String>,
}Fields§
§players: DashMap<String, ConnectedPlayer>§rooms: DashMap<String, Room>§server_key: String§max_rooms: usize§official_key: Option<String>§analytics: AnalyticsHandle§identity: IdentityVerifier§direct_transport: boolSee ServerConfig::direct_transport. Fails closed.
ice_servers: Vec<IceServer>See ServerConfig::ice_servers.
lobby_chat: Mutex<ChatHistory>§seal: Option<MessageSealer>§art_base_url: Option<String>Implementations§
Source§impl ServerState
impl ServerState
pub fn new( server_key: String, max_rooms: usize, official_key: Option<String>, analytics: AnalyticsHandle, hub_jwks_url: Option<String>, seal: Option<MessageSealer>, ) -> Self
pub fn with_direct_transport( self, enabled: bool, ice_servers: Vec<IceServer>, ) -> Self
Sourcepub fn with_art_base_url(self, url: Option<String>) -> Self
pub fn with_art_base_url(self, url: Option<String>) -> Self
Where this relay serves card art, handed to every client at auth. A self-hosted box holding the images is the reason to run one, and the client cannot guess the port.
pub fn session_by_username(&self, username: &str) -> Option<UsernameSession>
Auto Trait Implementations§
impl !Freeze for ServerState
impl !RefUnwindSafe for ServerState
impl !UnwindSafe for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more