Comments (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.
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)
- Modify Channel Information Delay
- Use References in Requests Where Possible HOT 2
- RUSTSEC-2021-0141: dotenv is Unmaintained
- Parsing event callback failed with "UnimplementedEvent" on mock API HOT 4
- Trait to turn paginated APIs into async streams HOT 1
- Make user agent more distinct
- Impossible to use requests / body with DeserializeOwned HOT 5
- EventSub Over WebSocket HOT 3
- Why can't I put multiple broadcaster_id in GetChannelInformationRequest? HOT 2
- Games: Get Games and Get Top Games IGDB Field
- Getting a backtrace with a specific broadcaster id 418158680 HOT 2
- introduce `beta` feature for public betas instead of `unsupported`
- Make `helix::client::custom` first-class
- another bug while decoding teaminfo HOT 4
- Add way to mock responses
- Investigate querying twitch docs HOT 1
- sprinkle more must_use on all structs
- Bors deprecation - remaining
- Clarify how or make it easier to pass in collections that are T: Iterator<Item=D> in builder functions for helix requests HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitch_api.