HoldMyType<p><a href="https://mathstodon.xyz/tags/cargo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>cargo</span></a> features are additive, ideally you should not use them for mutually exclusive configurations. however, if there's no easier alternative, at least you should explicitly check the invalid feature combinations and emit more helpful diagnostics for the user.<br>if the features are not mutually exclusive, you should rethink how you design the library. for example, instead of calling the runtime internally to do the IO, you can return a data type that encapsulate the operation, but let the user decide how to "run" it. in the case of async, it's usually done in the form of combinators of Futures. this is similar to the principle of policy based design in C++.</p><p>for your example specifically, what's the type of writer or reader?</p><p>for example, if it is either some Read type of tokio, or some Read type of async-std, then it should be clear, the feature "tokio" and "async-std" is mutually exclusive.<br><a href="https://mathstodon.xyz/tags/rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rust</span></a> <br><a href="https://users.rust-lang.org/t/multiple-applicable-items-in-scope/125632/2" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">users.rust-lang.org/t/multiple</span><span class="invisible">-applicable-items-in-scope/125632/2</span></a></p>