mkawalec / deluge Goto Github PK
View Code? Open in Web Editor NEWDeluge, not a stream
License: Mozilla Public License 2.0
Deluge, not a stream
License: Mozilla Public License 2.0
For reasons that escape me, trying to instantiate a filter causes a compilation error saying that Filter
does not implement the Deluge
trait. This is contrary to Filter
implementing a Deluge
with the exact same parameter bounds as it is instantiated with.
It is essential we figure out why the trait cannot be instantiated and fix the root cause.
The full error message after uncommenting the test:
error[E0599]: the method `collect` exists for struct `filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>`, but its trait bounds were not satisfied
--> src/deluge_ext.rs:423:14
|
423 | .collect::<Vec<usize>>().await;
| ^^^^^^^ method cannot be called on `filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>` due to unsatisfied trait bounds
|
::: src/ops/filter.rs:4:1
|
4 | pub struct Filter<Del, F> {
| -------------------------
| |
| method `collect` not found for this struct
| doesn't satisfy `_: Deluge<'_>`
| doesn't satisfy `_: Iterator`
| doesn't satisfy `_: deluge_ext::DelugeExt<'_>`
|
note: the following trait bounds were not satisfied:
`&filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>: Deluge<'_>`
`&mut filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>: Deluge<'_>`
`filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>: Deluge<'_>`
--> src/deluge_ext.rs:7:42
|
7 | impl<'a, T> DelugeExt<'a> for T where T: Deluge<'a> {}
| ------------- - ^^^^^^^^^^ unsatisfied trait bound introduced here
= note: the following trait bounds were not satisfied:
`filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>: Iterator`
which is required by `&mut filter::Filter<iter::Iter<std::ops::Range<{integer}>>, [closure@src/deluge_ext.rs:420:21: 420:26]>: Iterator`
note: the following traits must be implemented
--> src/deluge.rs:11:1
|
11 | pub trait Deluge<'a> {
| ^^^^^^^^^^^^^^^^^^^^
|
::: /home/michal/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:67:1
|
67 | pub trait Iterator {
| ^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0599`.
error: could not compile `deluge` due to previous error
Hi!
I have a stream that I cannot control that I would like to operate over in parallel. What options do I have here?
Cheers
Alex
I'm just curious why this requires nightly, and if there are any plans to bring it to stable rust in near-ish future?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.