davidMcneil / rants

An async NATS client library for the Rust programming language.
Apache License 2.0
81 stars 11 forks source link

Error compile #12

Closed DAOCUONG closed 4 years ago

DAOCUONG commented 4 years ago

Hi i have compile errors

error[E0432]: unresolved import tokio::codec --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/codec.rs:8:12 | 8 | use tokio::codec::Decoder; | ^^^^^ could not find codec in tokio

error[E0432]: unresolved import tokio::net::TcpStream --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/types/state.rs:2:5 | 2 | use tokio::net::TcpStream; | ^^^^^^^^^^^^^^^^^^^^^ no TcpStream in net

error[E0432]: unresolved import tokio_io::split --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/types/state.rs:3:15 | 3 | use tokio_io::split::WriteHalf; | ^^^^^ could not find split in tokio_io

error[E0432]: unresolved import tokio::sync::mpsc --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/types.rs:15:18 | 15 | use tokio::sync::mpsc::Sender as MpscSender; | ^^^^ could not find mpsc in sync

error[E0432]: unresolved imports tokio::codec, tokio::io::AsyncWriteExt, tokio::net::tcp, tokio::sync::mpsc, tokio::sync::oneshot, tokio::sync::watch, tokio::sync::watch, tokio::timer, tokio::timer --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:79:5 79 codec::FramedRead, ^^^^^ could not find codec in tokio 80 io::AsyncWriteExt, ^^^^-------------
help: a similar name exists in the module: AsyncWrite
no AsyncWriteExt in io
81 net::tcp::TcpStream,
^^^ could not find tcp in net
82 sync::{
83 mpsc, oneshot,
^^^^ ^^^^^^^ no oneshot in sync
no mpsc in sync
84 watch::{self, Sender as WatchSender},
^^^^^ ^^^^ no watch in sync
could not find watch in sync
85 },
86 timer::{self, Timeout},
^^^^^ ^^^^ no timer in the root
could not find timer in tokio
error[E0432]: unresolved imports tokio_io::split, tokio_io::split --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:88:23 88 use tokio_io::split::{self, ReadHalf, WriteHalf}; ^^^^^ ^^^^ no split in the root
could not find split in tokio_io
error[E0432]: unresolved imports tokio::sync::mpsc, tokio::sync::watch --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:100:23 100 pub use tokio::sync::{mpsc::Receiver as MpscReceiver, watch::Receiver as WatchReceiver}; ^^^^ ^^^^^ could not find watch in sync
could not find mpsc in sync
error[E0425]: cannot find function spawn in crate tokio --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:756:20 756 tokio::spawn(Self::type_erased_server_messages_handler( ^^^^^ not found in tokio help: possible candidate is found in another module, you can import it into scope
60 use std::thread::spawn;
error[E0425]: cannot find function spawn in crate tokio --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:778:20 778 tokio::spawn(async move { ^^^^^ not found in tokio help: possible candidate is found in another module, you can import it into scope
60 use std::thread::spawn;
error[E0425]: cannot find function spawn in crate tokio --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:1018:20 1018 tokio::spawn(Self::connect(Client::clone(&wrapped_client))); ^^^^^ not found in tokio help: possible candidate is found in another module, you can import it into scope
60 use std::thread::spawn;
error[E0425]: cannot find function spawn in crate tokio --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:1041:32 1041 tokio::spawn(async move { ^^^^^ not found in tokio help: possible candidate is found in another module, you can import it into scope
60 use std::thread::spawn;
error[E0425]: cannot find function spawn in crate tokio --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:1056:28 1056 tokio::spawn(async move { ^^^^^ not found in tokio help: possible candidate is found in another module, you can import it into scope
60 use std::thread::spawn;
error[E0425]: cannot find function spawn in crate tokio --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:1078:24 1078 tokio::spawn(async move { ^^^^^ not found in tokio help: possible candidate is found in another module, you can import it into scope
60 use std::thread::spawn;

error[E0603]: module sync is private --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/types.rs:15:12 | 15 | use tokio::sync::mpsc::Sender as MpscSender; | ^^^^

error[E0603]: module sync is private --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:82:5 | 82 | sync::{ | ^^^^

error[E0603]: module sync is private --> /Users/velimir/.cargo/registry/src/github.com-1ecc6299db9ec823/rants-0.3.1/src/lib.rs:100:16 | 100 | pub use tokio::sync::{mpsc::Receiver as MpscReceiver, watch::Receiver as WatchReceiver}; | ^^^^

error: aborting due to 16 previous errors

Some errors have detailed explanations: E0425, E0432, E0603. For more information about an error, try rustc --explain E0425. error: could not compile rants. warning: build failed, waiting for other jobs to finish... error: build failed

davidMcneil commented 4 years ago

What version of tokio are you using? It looks like you are using version 0.2. rants version 0.3 requires tokio 0.1. The rants master branch should work with tokio 0.2. I hope to put out rants version 0.4 soon which will work with tokio 0.2.

DAOCUONG commented 4 years ago

thanks you for your response i tried to use master branch but still have error Updating crates.io index error: failed to select a version for mio. ... required by package tokio v0.2.1 ... which is depended on by rants v0.3.1 (https://github.com/davidMcneil/rants.git#7739743f) ... which is depended on by spacheckinrust v0.1.0 (/Users/velimir/Documents/Zentech/spacheckinrust) versions that meet the requirements ^0.6.20 are: 0.6.21, 0.6.20

all possible versions conflict with previously selected packages.

previously selected package mio v0.6.19 ... which is depended on by actix-server v0.6.1 ... which is depended on by actix-testing v0.1.0 ... which is depended on by actix-web v1.0.8

davidMcneil commented 4 years ago

If you delete your Cargo.lock and try and rebuild what happens?

DAOCUONG commented 4 years ago

delete cargo.lock works