Coder Social home page Coder Social logo

Comments (2)

Emilgardis avatar Emilgardis commented on August 17, 2024 2

please try the newly released 0.7.0-rc.4 and see if that works (I'm pretty sure it does) :D

good luck learning rust!

from twitch_api.

Emilgardis avatar Emilgardis commented on August 17, 2024

Hi! Thanks for the report!

I know what this error is and I'll get it fixed, the problem is that some of the functions are using a wrong bound. I'll get this fixed asap

   Compiling rust_twitch_bot v0.1.0 (/home/glog78/source/rust_twitch_bot)
error: future cannot be sent between threads safely
   --> src/main.rs:61:44
    |
61  |   let _find_st_member_thread = tokio::spawn( async move {
    |  ____________________________________________^
62  | |
63  | |     let twitch: TwitchClient<TwitchHttpClient> = TwitchClient::default();
64  | |
...   |
98  | |    }
99  | | });
    | |_^ future created by async block is not `Send`
    |
    = help: the trait `std::marker::Send` is not implemented for `dyn futures::Stream<Item = Result<twitch_api::helix::streams::Stream, ClientRequestError<reqwest::Error>>>`
note: future is not `Send` as this value is used across an await
   --> src/main.rs:90:114
    |
90  |         let ch: Vec<twitch_api::helix::streams::Stream> = twitch.helix.get_followed_streams(&token).try_collect().await.expect("something");
    |                                                           -----------------------------------------              ^^^^^^ await occurs here, with `twitch.helix.get_followed_streams(&token)` maybe used later
    |                                                           |
    |                                                           has type `Pin<Box<dyn futures::Stream<Item = Result<twitch_api::helix::streams::Stream, ClientRequestError<reqwest::Error>>>>>` which is not `Send`
note: `twitch.helix.get_followed_streams(&token)` is later dropped here
   --> src/main.rs:90:140
    |
90  |         let ch: Vec<twitch_api::helix::streams::Stream> = twitch.helix.get_followed_streams(&token).try_collect().await.expect("something");
    |                                                                                                                                            ^
note: required by a bound in `tokio::spawn`
   --> /home/glog78/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/task/spawn.rs:163:21
    |
163 |         T: Future + Send + 'static,
    |                     ^^^^ required by this bound in `tokio::spawn`

error: could not compile `rust_twitch_bot` due to previous error

from twitch_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.