mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
use tokio-codec
This commit is contained in:
parent
53db39f0c8
commit
1a3707649e
5 changed files with 7 additions and 5 deletions
|
@ -7,6 +7,7 @@ authors = ["Astro <astro@spaceboyz.net>"]
|
|||
futures = "^0.1"
|
||||
tokio-core = "^0.1"
|
||||
tokio-io = "^0.1"
|
||||
tokio-codec = "^0.1"
|
||||
bytes = "0.4.9"
|
||||
xml5ever = "*"
|
||||
tendril = "*"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
extern crate futures;
|
||||
extern crate tokio_core;
|
||||
extern crate tokio_io;
|
||||
extern crate tokio_codec;
|
||||
extern crate bytes;
|
||||
extern crate xml5ever;
|
||||
extern crate tendril;
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::mem::replace;
|
|||
use std::io::{Error, ErrorKind};
|
||||
use futures::{Future, Async, Poll, Stream, sink, Sink};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use tokio_io::codec::Framed;
|
||||
use tokio_codec::Framed;
|
||||
use jid::Jid;
|
||||
use minidom::Element;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::str::from_utf8;
|
|||
use std::io::{Error, ErrorKind};
|
||||
use std::collections::HashMap;
|
||||
use std::collections::vec_deque::VecDeque;
|
||||
use tokio_io::codec::{Encoder, Decoder};
|
||||
use tokio_codec::{Encoder, Decoder};
|
||||
use minidom::Element;
|
||||
use xml5ever::tokenizer::{XmlTokenizer, TokenSink, Token, Tag, TagKind};
|
||||
use xml5ever::interface::Attribute;
|
||||
|
@ -430,7 +430,7 @@ mod tests {
|
|||
fn test_large_stanza() {
|
||||
use std::io::Cursor;
|
||||
use futures::{Future, Sink};
|
||||
use tokio_io::codec::FramedWrite;
|
||||
use tokio_codec::FramedWrite;
|
||||
let framed = FramedWrite::new(Cursor::new(vec![]), XMPPCodec::new());
|
||||
let mut text = "".to_owned();
|
||||
for _ in 0..2usize.pow(15) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use futures::{Poll, Stream, Sink, StartSend};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use tokio_io::codec::Framed;
|
||||
use tokio_codec::Framed;
|
||||
use minidom::Element;
|
||||
use jid::Jid;
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl<S: AsyncRead + AsyncWrite> XMPPStream<S> {
|
|||
}
|
||||
|
||||
pub fn start(stream: S, jid: Jid, ns: String) -> StreamStart<S> {
|
||||
let xmpp_stream = AsyncRead::framed(stream, XMPPCodec::new());
|
||||
let xmpp_stream = Framed::new(stream, XMPPCodec::new());
|
||||
StreamStart::from_stream(xmpp_stream, jid, ns)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue