From d5c27d6b6373c49ed0348215d31a7e42c577f12c Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Thu, 19 Jul 2018 11:40:09 +0200 Subject: [PATCH] ws/frame: Rename `FramedBinary` type to `FramedMessage` --- src/ws/client.rs | 4 ++-- src/ws/context.rs | 4 ++-- src/ws/frame.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ws/client.rs b/src/ws/client.rs index f1b30e20b..18789fef8 100644 --- a/src/ws/client.rs +++ b/src/ws/client.rs @@ -27,7 +27,7 @@ use client::{ Pipeline, SendRequest, SendRequestError, }; -use super::frame::{Frame, FramedBinary}; +use super::frame::{Frame, FramedMessage}; use super::proto::{CloseReason, OpCode}; use super::{Message, ProtocolError, WsWriter}; @@ -529,7 +529,7 @@ pub struct ClientWriter { impl ClientWriter { /// Write payload #[inline] - fn write(&mut self, mut data: FramedBinary) { + fn write(&mut self, mut data: FramedMessage) { let inner = self.inner.borrow_mut(); if !inner.closed { let _ = inner.tx.unbounded_send(data.0.take()); diff --git a/src/ws/context.rs b/src/ws/context.rs index 1dab15713..4db83df5c 100644 --- a/src/ws/context.rs +++ b/src/ws/context.rs @@ -20,7 +20,7 @@ use context::{ActorHttpContext, Drain, Frame as ContextFrame}; use error::{Error, ErrorInternalServerError, PayloadError}; use httprequest::HttpRequest; -use ws::frame::{Frame, FramedBinary}; +use ws::frame::{Frame, FramedMessage}; use ws::proto::{CloseReason, OpCode}; use ws::{Message, ProtocolError, WsStream, WsWriter}; @@ -138,7 +138,7 @@ where /// data you should prefer the `text()` or `binary()` convenience functions /// that handle the framing for you. #[inline] - pub fn write_raw(&mut self, data: FramedBinary) { + pub fn write_raw(&mut self, data: FramedMessage) { if !self.disconnected { if self.stream.is_none() { self.stream = Some(SmallVec::new()); diff --git a/src/ws/frame.rs b/src/ws/frame.rs index 964170a86..1b62be99b 100644 --- a/src/ws/frame.rs +++ b/src/ws/frame.rs @@ -28,7 +28,7 @@ impl Frame { /// Create a new Close control frame. #[inline] - pub fn close(reason: Option, genmask: bool) -> FramedBinary { + pub fn close(reason: Option, genmask: bool) -> FramedMessage { let payload = match reason { None => Vec::new(), Some(reason) => { @@ -295,7 +295,7 @@ impl Frame { /// Generate binary representation pub fn message>( data: B, code: OpCode, finished: bool, genmask: bool, - ) -> FramedBinary { + ) -> FramedMessage { let payload = data.into(); let one: u8 = if finished { 0x80 | Into::::into(code) @@ -337,7 +337,7 @@ impl Frame { buf.into() }; - FramedBinary(binary) + FramedMessage(binary) } } @@ -376,7 +376,7 @@ impl fmt::Display for Frame { /// A `Binary` representing a `WebSocket` message with framing. #[derive(Debug)] -pub struct FramedBinary(pub Binary); +pub struct FramedMessage(pub Binary); #[cfg(test)] mod tests {