mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 18:37:41 +02:00
refactor h1 stream polling
This commit is contained in:
@ -139,8 +139,8 @@ impl<A, S> WebsocketContext<A, S> where A: Actor<Context=Self> {
|
||||
|
||||
/// Send text frame
|
||||
#[inline]
|
||||
pub fn text(&mut self, text: &str) {
|
||||
self.write(Frame::message(Vec::from(text), OpCode::Text, true).generate(false));
|
||||
pub fn text<T: Into<String>>(&mut self, text: T) {
|
||||
self.write(Frame::message(text.into(), OpCode::Text, true).generate(false));
|
||||
}
|
||||
|
||||
/// Send binary frame
|
||||
|
@ -30,7 +30,7 @@
|
||||
//! fn handle(&mut self, msg: ws::Message, ctx: &mut Self::Context) {
|
||||
//! match msg {
|
||||
//! ws::Message::Ping(msg) => ctx.pong(&msg),
|
||||
//! ws::Message::Text(text) => ctx.text(&text),
|
||||
//! ws::Message::Text(text) => ctx.text(text),
|
||||
//! ws::Message::Binary(bin) => ctx.binary(bin),
|
||||
//! _ => (),
|
||||
//! }
|
||||
|
Reference in New Issue
Block a user