quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.57k stars 364 forks source link

Document cancel-safety of stream I/O operations #1764

Closed Ralith closed 4 months ago

Ralith commented 4 months ago

Fixes #1763.

Ralith commented 4 months ago

I tried to cover that in the type-level documentation, to limit repetition:

A read method is said to be cancel-safe when dropping its future before the future becomes ready cannot lead to loss of stream data.

i.e. the non-safe scenario does not provide that guarantee. Does that need to be further clarified? It's a fairly precise statement already.

djc commented 4 months ago

Yeah, I guess it's good enough.