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
Source§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 Freeze for ClientConnection
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
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