doc-push icon indicating copy to clipboard operation
doc-push copied to clipboard

API guidelines for asynchronous libraries

Open jonhoo opened this issue 5 years ago • 2 comments

The Rust API guidelines are a initiative for making Rust libraries feel more similar. Something similar should exist for asynchronous libraries. Should my methods take &self or self? Should I return (Self, X) or (X, Self)? How do I return Self on error if I take &self?

jonhoo avatar Oct 16 '18 16:10 jonhoo

I don’t know if we want to be as strict as the rust api guidelines or is we would have as much content . Maybe this would work as a page in the cookbooks section?

carllerche avatar Oct 17 '18 20:10 carllerche

I don't think it needs to be quite as strict, but some guidelines/best practices I think would help a lot. Might also encourage some more interface uniformity in the ecosystem.

jonhoo avatar Oct 18 '18 16:10 jonhoo