mirror of
https://github.com/actix/actix-extras.git
synced 2025-07-01 12:15:08 +02:00
re-introduce Body type, use Body as default body type for Response
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
use bytes::BytesMut;
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use tokio_codec::{Decoder, Encoder};
|
||||
|
||||
use super::frame::Parser;
|
||||
use super::proto::{CloseReason, OpCode};
|
||||
use super::ProtocolError;
|
||||
use body::Binary;
|
||||
|
||||
/// `WebSocket` Message
|
||||
#[derive(Debug, PartialEq)]
|
||||
@ -12,7 +11,7 @@ pub enum Message {
|
||||
/// Text message
|
||||
Text(String),
|
||||
/// Binary message
|
||||
Binary(Binary),
|
||||
Binary(Bytes),
|
||||
/// Ping message
|
||||
Ping(String),
|
||||
/// Pong message
|
||||
|
@ -1,8 +1,7 @@
|
||||
use byteorder::{ByteOrder, LittleEndian, NetworkEndian};
|
||||
use bytes::{BufMut, BytesMut};
|
||||
use bytes::{BufMut, Bytes, BytesMut};
|
||||
use rand;
|
||||
|
||||
use body::Binary;
|
||||
use ws::mask::apply_mask;
|
||||
use ws::proto::{CloseCode, CloseReason, OpCode};
|
||||
use ws::ProtocolError;
|
||||
@ -151,7 +150,7 @@ impl Parser {
|
||||
}
|
||||
|
||||
/// Generate binary representation
|
||||
pub fn write_message<B: Into<Binary>>(
|
||||
pub fn write_message<B: Into<Bytes>>(
|
||||
dst: &mut BytesMut,
|
||||
pl: B,
|
||||
op: OpCode,
|
||||
|
Reference in New Issue
Block a user