Using polymorphic async closures in rust

Поделиться
HTML-код
  • Опубликовано: 19 янв 2025

Комментарии • 10

  • @zveroboy85
    @zveroboy85 14 дней назад +4

    Things are getting much more complicated when you deal with async in Rust. Thanks for your research and explanation.

    • @mathiascodes
      @mathiascodes  14 дней назад

      Glad to help! It's complicated to talk about in a semi-coherent way 😄

  • @taquanminhlong
    @taquanminhlong 4 дня назад +3

    Demn, this is so underrated, you deserve more subs 💪

  • @theopantamis9184
    @theopantamis9184 6 дней назад +3

    Nice video thank you !
    I think it is better in the anonymous lifetime trick to use the new "use" keyword. This is because the trait bound constraints your Future to live at least for '_ but I think you actually want to say that it must live at most for '_. You can have many issues satisfying the borrow checker to accept your callback by not using the correct lifetime constraint like this in the API.
    So I think your type should be Box>>>
    If you use an older Rust version you would use the "Capture Trick" instead.

    • @crimsonmegumin
      @crimsonmegumin 4 дня назад

      IIRC, this behaviour will be default without the use keyword in the Rust 2024 Edition

  • @KribbieChris
    @KribbieChris 16 дней назад +2

    Great video!

  • @Ialissele
    @Ialissele День назад

    *RUclipsErs