[−][src]Struct ws_actix_web::MyWebSocket
websocket connection is long running connection, it easier to handle with an actor
Methods
impl MyWebSocket
[src]
pub fn new() -> Self
[src]
pub fn hb(&self, ctx: &mut Self::Context)
[src]
helper method that sends ping to client every second.
also this method checks heartbeats from client
Trait Implementations
impl Actor for MyWebSocket
[src]
type Context = WebsocketContext<Self>
Actor execution context type
fn started(&mut self, ctx: &mut Self::Context)
[src]
Method is called on actor start. We start the heartbeat process here.
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]
fn stopped(&mut self, ctx: &mut Self::Context)
[src]
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]
Self: Actor<Context = Context<Self>>,
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]
Self: Actor<Context = Context<Self>> + Default,
fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self> where
F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
Self: Actor<Context = Context<Self>>,
[src]
F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
Self: Actor<Context = Context<Self>>,
fn create<F>(f: F) -> Addr<Self> where
F: FnOnce(&mut Context<Self>) -> Self,
Self: Actor<Context = Context<Self>>,
[src]
F: FnOnce(&mut Context<Self>) -> Self,
Self: Actor<Context = Context<Self>>,
impl StreamHandler<Result<Message, ProtocolError>> for MyWebSocket
[src]
Handler for ws::Message
fn handle(
&mut self,
msg: Result<Message, ProtocolError>,
ctx: &mut Self::Context
)
[src]
&mut self,
msg: Result<Message, ProtocolError>,
ctx: &mut Self::Context
)
fn started(&mut self, ctx: &mut Self::Context)
[src]
fn finished(&mut self, ctx: &mut Self::Context)
[src]
fn add_stream<S>(fut: S, ctx: &mut Self::Context) -> SpawnHandle where
I: 'static,
S: Stream<Item = I> + 'static,
Self::Context: AsyncContext<Self>,
[src]
I: 'static,
S: Stream<Item = I> + 'static,
Self::Context: AsyncContext<Self>,
Auto Trait Implementations
impl RefUnwindSafe for MyWebSocket
impl Send for MyWebSocket
impl Sync for MyWebSocket
impl Unpin for MyWebSocket
impl UnwindSafe for MyWebSocket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,