Effing-mad, an effect library for Rust
For those of you following along with keyword generics in Rust, the current proposal is this [0]:<p><pre><code>    trait ?const ?async Read {
        ?const ?async fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
        ?const ?async fn read_to_string(&mut self, buf: &mut String) -> Result<usize> { .. }
    }
    
    /// Read from a reader into a string.
    ?const ?async fn read_to_string(reader: &mut impl ?const ?async Read) -> io::Result<String> {
        let mut string = String::new();
        reader.read_to_string(&mut string).await?;
        Ok(string)
    }
</code></pre>
which was rightfully disliked [1]. There have been some other proposals however, such as this one I wrote about [2]<p><pre><code>    fn foo<F, T>(closure: F) -> Option<T>
    where 
        F: FnMut(&T) -> bool,
    effect 
        const if F: const,
        ?async,
    { /* ... */ }
</code></pre>
for which someone made a more detailed issue [3]. It is similar to a `where` clause in that the `effect` clause comes afterwards and defines the effects that a function can have.<p>[0] <a href="https://blog.rust-lang.org/inside-rust/2023/02/23/keyword-generics-progress-report-feb-2023.html" rel="nofollow">https://blog.rust-lang.org/inside-rust/2023/02/23/keyword-ge...</a><p>[1] <a href="https://old.reddit.com/r/rust/comments/119y8ex/keyword_generics_progress_report_february_2023/" rel="nofollow">https://old.reddit.com/r/rust/comments/119y8ex/keyword_gener...</a><p>[2] <a href="https://github.com/rust-lang/keyword-generics-initiative/issues/10#issuecomment-1442608467">https://github.com/rust-lang/keyword-generics-initiative/iss...</a><p>[3] <a href="https://github.com/rust-lang/keyword-generics-initiative/issues/14">https://github.com/rust-lang/keyword-generics-initiative/iss...</a>