mirror of https://github.com/fafhrd91/actix-web
ws/context: Rename `write()` to `write_raw()`
This commit is contained in:
parent
984b8caf5a
commit
f53abed584
|
@ -138,7 +138,7 @@ where
|
||||||
/// data you should prefer the `text()` or `binary()` convenience functions
|
/// data you should prefer the `text()` or `binary()` convenience functions
|
||||||
/// that handle the framing for you.
|
/// that handle the framing for you.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn write(&mut self, data: Binary) {
|
pub fn write_raw(&mut self, data: Binary) {
|
||||||
if !self.disconnected {
|
if !self.disconnected {
|
||||||
if self.stream.is_none() {
|
if self.stream.is_none() {
|
||||||
self.stream = Some(SmallVec::new());
|
self.stream = Some(SmallVec::new());
|
||||||
|
@ -172,19 +172,19 @@ where
|
||||||
/// Send text frame
|
/// Send text frame
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn text<T: Into<Binary>>(&mut self, text: T) {
|
pub fn text<T: Into<Binary>>(&mut self, text: T) {
|
||||||
self.write(Frame::message(text.into(), OpCode::Text, true, false));
|
self.write_raw(Frame::message(text.into(), OpCode::Text, true, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Send binary frame
|
/// Send binary frame
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn binary<B: Into<Binary>>(&mut self, data: B) {
|
pub fn binary<B: Into<Binary>>(&mut self, data: B) {
|
||||||
self.write(Frame::message(data, OpCode::Binary, true, false));
|
self.write_raw(Frame::message(data, OpCode::Binary, true, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Send ping frame
|
/// Send ping frame
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn ping(&mut self, message: &str) {
|
pub fn ping(&mut self, message: &str) {
|
||||||
self.write(Frame::message(
|
self.write_raw(Frame::message(
|
||||||
Vec::from(message),
|
Vec::from(message),
|
||||||
OpCode::Ping,
|
OpCode::Ping,
|
||||||
true,
|
true,
|
||||||
|
@ -195,7 +195,7 @@ where
|
||||||
/// Send pong frame
|
/// Send pong frame
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn pong(&mut self, message: &str) {
|
pub fn pong(&mut self, message: &str) {
|
||||||
self.write(Frame::message(
|
self.write_raw(Frame::message(
|
||||||
Vec::from(message),
|
Vec::from(message),
|
||||||
OpCode::Pong,
|
OpCode::Pong,
|
||||||
true,
|
true,
|
||||||
|
@ -206,7 +206,7 @@ where
|
||||||
/// Send close frame
|
/// Send close frame
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn close(&mut self, reason: Option<CloseReason>) {
|
pub fn close(&mut self, reason: Option<CloseReason>) {
|
||||||
self.write(Frame::close(reason, false));
|
self.write_raw(Frame::close(reason, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if connection still open
|
/// Check if connection still open
|
||||||
|
|
Loading…
Reference in New Issue