struct ClientConnection {
client_id: Uuid,
last_pong: Instant,
ping_handle: Option<SpawnHandle>,
}
Fields§
§client_id: Uuid
§last_pong: Instant
§ping_handle: Option<SpawnHandle>
Implementations§
Trait Implementations§
source§impl Actor for ClientConnection
impl Actor for ClientConnection
§type Context = WebsocketContext<ClientConnection>
type Context = WebsocketContext<ClientConnection>
Actor execution context type
source§fn started(&mut self, ctx: &mut Self::Context)
fn started(&mut self, ctx: &mut Self::Context)
Called when an actor gets polled the first time.
source§impl StreamHandler<Result<Message, ProtocolError>> for ClientConnection
impl StreamHandler<Result<Message, ProtocolError>> for ClientConnection
source§fn handle(
&mut self,
item: Result<Message, ProtocolError>,
ctx: &mut Self::Context
)
fn handle( &mut self, item: Result<Message, ProtocolError>, ctx: &mut Self::Context )
Called for every message emitted by the stream.
source§fn add_stream<S>(stream: S, ctx: &mut Self::Context) -> SpawnHandlewhere
S: Stream + 'static,
Self: StreamHandler<<S as Stream>::Item>,
Self::Context: AsyncContext<Self>,
fn add_stream<S>(stream: S, ctx: &mut Self::Context) -> SpawnHandlewhere
S: Stream + 'static,
Self: StreamHandler<<S as Stream>::Item>,
Self::Context: AsyncContext<Self>,
Register a Stream to the actor context.
Auto Trait Implementations§
impl RefUnwindSafe for ClientConnection
impl Send for ClientConnection
impl Sync for ClientConnection
impl Unpin for ClientConnection
impl UnwindSafe for ClientConnection
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