pub struct ServerState {
pub options: ServerOptions,
pub handler: Handler,
pub connection_counter: RwLock<u64>,
}Expand description
Shared state for all connections to a server.
Fields§
§options: ServerOptionsServer options.
handler: HandlerComposed handler (middleware + main handler).
connection_counter: RwLock<u64>Connection counter for generating IDs.
Implementations§
Source§impl ServerState
impl ServerState
Sourcepub fn new(options: ServerOptions) -> Self
pub fn new(options: ServerOptions) -> Self
Creates new server state from options.
Sourcepub fn next_connection_id(&self) -> u64
pub fn next_connection_id(&self) -> u64
Returns the next connection ID.
Auto Trait Implementations§
impl !Freeze for ServerState
impl !RefUnwindSafe for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl !UnwindSafe 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