11

I have an async fn that returns a type, and want to implement Drop on that type that calls another async function. It's not clear how to do this, and I can't find anything in the docs. The most illuminating article I found is Asynchronous Destructors by withoutboats, but I don't really understand the reasoning, or where this feature is at.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
  • 3
    The point of the article is precisely to said that it's not currently possible. And propose a possible solution, but AFAIK it doesn't exist yet. – Stargateur Jan 17 '20 at 06:47

1 Answers1

6

It's not clear how to do this, and I can't find anything in the docs

That's because it's not possible; there is no "async Drop". Drop must be synchronous.

See also:

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366