async-std icon indicating copy to clipboard operation
async-std copied to clipboard

Not able to import FilterMap type

Open Plebshot opened this issue 2 years ago • 1 comments

As title says, i'm trying to get the FilterMap type into scope to store one in a struct. It does not seem to exist on any imports although the source code shows it. It's also not showing up on docs.rs search image

Plebshot avatar Apr 02 '22 04:04 Plebshot

For some reason, async_std follows a pattern where Future combinator types are pub, but defined in non-pub modules. This isn't the pattern followed for Stream combinators, however.

The issue with FilterMap is that it was added to the "future" non-pub use section of https://github.com/async-rs/async-std/blob/bf316b095c176c8738c6401cc62d0bc389c88961/src/stream/stream/mod.rs#L74 instead of the "stream" pub use section below at https://github.com/async-rs/async-std/blob/bf316b095c176c8738c6401cc62d0bc389c88961/src/stream/stream/mod.rs#L98.

zjijz avatar Nov 30 '22 18:11 zjijz