pub struct CheckpointWebSocketServer { /* private fields */ }Expand description
WebSocket server for checkpointing
Implementations§
Source§impl CheckpointWebSocketServer
impl CheckpointWebSocketServer
Sourcepub fn new(
bind_addr: impl Into<String>,
service: Arc<CheckpointService>,
) -> Self
pub fn new( bind_addr: impl Into<String>, service: Arc<CheckpointService>, ) -> Self
Create a new WebSocket server with default config
Sourcepub fn with_config(
bind_addr: impl Into<String>,
service: Arc<CheckpointService>,
config: WebSocketConfig,
) -> Self
pub fn with_config( bind_addr: impl Into<String>, service: Arc<CheckpointService>, config: WebSocketConfig, ) -> Self
Create a new WebSocket server with custom config
Sourcepub async fn start(&mut self) -> Result<SocketAddr>
pub async fn start(&mut self) -> Result<SocketAddr>
Start the server and return the bound address
Sourcepub async fn client_count(&self) -> usize
pub async fn client_count(&self) -> usize
Get number of connected clients
Auto Trait Implementations§
impl Freeze for CheckpointWebSocketServer
impl !RefUnwindSafe for CheckpointWebSocketServer
impl Send for CheckpointWebSocketServer
impl Sync for CheckpointWebSocketServer
impl Unpin for CheckpointWebSocketServer
impl UnsafeUnpin for CheckpointWebSocketServer
impl !UnwindSafe for CheckpointWebSocketServer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more