mirror of https://github.com/fafhrd91/actix-web
Fix formatting.
This commit is contained in:
parent
ee9fe60ccb
commit
70ffab8368
|
@ -27,7 +27,7 @@ use futures::{Async, Future, Poll, Stream};
|
||||||
|
|
||||||
/// Do websocket handshake and start ws actor.
|
/// Do websocket handshake and start ws actor.
|
||||||
pub fn start<A, T>(actor: A, req: &HttpRequest, stream: T) -> Result<HttpResponse, Error>
|
pub fn start<A, T>(actor: A, req: &HttpRequest, stream: T) -> Result<HttpResponse, Error>
|
||||||
where
|
where
|
||||||
A: Actor<Context = WebsocketContext<A>> + StreamHandler<Message, ProtocolError>,
|
A: Actor<Context = WebsocketContext<A>> + StreamHandler<Message, ProtocolError>,
|
||||||
T: Stream<Item = Bytes, Error = PayloadError> + 'static,
|
T: Stream<Item = Bytes, Error = PayloadError> + 'static,
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ pub fn handshake(req: &HttpRequest) -> Result<HttpResponseBuilder, HandshakeErro
|
||||||
|
|
||||||
/// Execution context for `WebSockets` actors
|
/// Execution context for `WebSockets` actors
|
||||||
pub struct WebsocketContext<A>
|
pub struct WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = WebsocketContext<A>>,
|
A: Actor<Context = WebsocketContext<A>>,
|
||||||
{
|
{
|
||||||
inner: ContextParts<A>,
|
inner: ContextParts<A>,
|
||||||
|
@ -109,7 +109,7 @@ pub struct WebsocketContext<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> ActorContext for WebsocketContext<A>
|
impl<A> ActorContext for WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = Self>,
|
A: Actor<Context = Self>,
|
||||||
{
|
{
|
||||||
fn stop(&mut self) {
|
fn stop(&mut self) {
|
||||||
|
@ -126,7 +126,7 @@ impl<A> ActorContext for WebsocketContext<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> AsyncContext<A> for WebsocketContext<A>
|
impl<A> AsyncContext<A> for WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = Self>,
|
A: Actor<Context = Self>,
|
||||||
{
|
{
|
||||||
fn spawn<F>(&mut self, fut: F) -> SpawnHandle
|
fn spawn<F>(&mut self, fut: F) -> SpawnHandle
|
||||||
|
@ -162,7 +162,7 @@ impl<A> AsyncContext<A> for WebsocketContext<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> WebsocketContext<A>
|
impl<A> WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = Self>,
|
A: Actor<Context = Self>,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -223,7 +223,7 @@ impl<A> WebsocketContext<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> WebsocketContext<A>
|
impl<A> WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = Self>,
|
A: Actor<Context = Self>,
|
||||||
{
|
{
|
||||||
/// Write payload
|
/// Write payload
|
||||||
|
@ -283,7 +283,7 @@ impl<A> WebsocketContext<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> AsyncContextParts<A> for WebsocketContext<A>
|
impl<A> AsyncContextParts<A> for WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = Self>,
|
A: Actor<Context = Self>,
|
||||||
{
|
{
|
||||||
fn parts(&mut self) -> &mut ContextParts<A> {
|
fn parts(&mut self) -> &mut ContextParts<A> {
|
||||||
|
@ -302,7 +302,7 @@ struct WebsocketContextFut<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> WebsocketContextFut<A>
|
impl<A> WebsocketContextFut<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = WebsocketContext<A>>,
|
A: Actor<Context = WebsocketContext<A>>,
|
||||||
{
|
{
|
||||||
fn new(ctx: WebsocketContext<A>, act: A, mailbox: Mailbox<A>, codec: Codec) -> Self {
|
fn new(ctx: WebsocketContext<A>, act: A, mailbox: Mailbox<A>, codec: Codec) -> Self {
|
||||||
|
@ -317,7 +317,7 @@ impl<A> WebsocketContextFut<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A> Stream for WebsocketContextFut<A>
|
impl<A> Stream for WebsocketContextFut<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = WebsocketContext<A>>,
|
A: Actor<Context = WebsocketContext<A>>,
|
||||||
{
|
{
|
||||||
type Item = Bytes;
|
type Item = Bytes;
|
||||||
|
@ -349,7 +349,7 @@ impl<A> Stream for WebsocketContextFut<A>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A, M> ToEnvelope<A, M> for WebsocketContext<A>
|
impl<A, M> ToEnvelope<A, M> for WebsocketContext<A>
|
||||||
where
|
where
|
||||||
A: Actor<Context = WebsocketContext<A>> + Handler<M>,
|
A: Actor<Context = WebsocketContext<A>> + Handler<M>,
|
||||||
M: ActixMessage + Send + 'static,
|
M: ActixMessage + Send + 'static,
|
||||||
M::Result: Send,
|
M::Result: Send,
|
||||||
|
@ -367,7 +367,7 @@ struct WsStream<S> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S> WsStream<S>
|
impl<S> WsStream<S>
|
||||||
where
|
where
|
||||||
S: Stream<Item = Bytes, Error = PayloadError>,
|
S: Stream<Item = Bytes, Error = PayloadError>,
|
||||||
{
|
{
|
||||||
fn new(stream: S, codec: Codec) -> Self {
|
fn new(stream: S, codec: Codec) -> Self {
|
||||||
|
@ -381,7 +381,7 @@ impl<S> WsStream<S>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S> Stream for WsStream<S>
|
impl<S> Stream for WsStream<S>
|
||||||
where
|
where
|
||||||
S: Stream<Item = Bytes, Error = PayloadError>,
|
S: Stream<Item = Bytes, Error = PayloadError>,
|
||||||
{
|
{
|
||||||
type Item = Message;
|
type Item = Message;
|
||||||
|
|
Loading…
Reference in New Issue