mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 08:57:00 +02:00
use Optional with websocket close reason
This commit is contained in:
@@ -15,7 +15,7 @@ use error::{Error, ErrorInternalServerError};
|
||||
use httprequest::HttpRequest;
|
||||
|
||||
use ws::frame::Frame;
|
||||
use ws::proto::{CloseCode, OpCode};
|
||||
use ws::proto::{CloseReason, OpCode};
|
||||
|
||||
/// Execution context for `WebSockets` actors
|
||||
pub struct WebsocketContext<A, S = ()>
|
||||
@@ -177,8 +177,8 @@ where
|
||||
|
||||
/// Send close frame
|
||||
#[inline]
|
||||
pub fn close(&mut self, code: CloseCode, reason: &str) {
|
||||
self.write(Frame::close(code, reason, false));
|
||||
pub fn close(&mut self, reason: Option<CloseReason>) {
|
||||
self.write(Frame::close(reason, false));
|
||||
}
|
||||
|
||||
/// Returns drain future
|
||||
|
Reference in New Issue
Block a user