tokio-rs / doc-push

Tokio doc blitz effort - A concerted effort to improve Tokio's documentation.
MIT License
50 stars 7 forks source link

API guidelines for asynchronous libraries #79

Open jonhoo opened 6 years ago

jonhoo commented 6 years ago

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?

carllerche commented 6 years ago

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?

jonhoo commented 6 years ago

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.