-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Umbrella: Repository Content (Scope)/ TODOs #116
Comments
I donno if relevant but one can simulate a reasonable degree of simple local inheritance without overloading by using inherent methods on a parent types whose subtypes are specified using type parameters rust-lang/rfcs#349 (comment) so generic methods on the polymorphic base become available to all children. In practice, one often needs sealed traits once this gets heavier, so then maybe a true trait interface makes sense, but sometimes the situation is quite simple. |
Nice, for sure! 💯 |
Today I discovered https://github.com/udoprog/patterns where |
Something new to addon for cell if anyone work on cell. https://plv.mpi-sws.org/rustbelt/ghostcell/ |
Collection of design patterns and the corresponding issues if not contained in the repository already (in reference to Design patterns (by Gamma, Helm, Johnson, Vlissides)). Some patterns are probably not applicable to/realizable with Rust as they stem from OOP, but we'll sort that out on the way.
But in general I think it is also nice to have
design patterns
listed somewhere on a page that are not applicable to Rust and stated why and with an added workaround if any.Coverage
Patterns
Creational Patterns
Structural Patterns
Behavioural Patterns
Still Uncategorized
by looking at examples such as Rusts
libstd
, and how it integrated into the Rusts source code, lessons can be learned about ergonomic project management and API design. Closely assosciated with platform-specific sub-modulesError
traits andResult
forwardingIdioms
"Vec::drain sets the Vec's len to 0 prematurely so that mem::forgetting Drain "only" mem::forgets more stuff. instead of exposing uninitialized memory or having to update the len on every iteration"
Anti-patterns
Unwrap()
ing everyResult
instead of forwarding itFunctional Programming
Refactoring
unwrap
toResult
General Unsorted
Notes
The markdown source of that post is here and I hereby relicense the content as MPL2 (in addition to CC-BY) and allow you to use it in this repo.
From Reddit
Pre-Pooping Your Pants
Rooting an Rc handle
Precise closure capture clauses
Iterating an over a Rc<Vec<T>>
https://users.rust-lang.org/t/blog-post-series-rust-patterns/20080/10
Push Ifs Up And Fors Down
If a Tree Falls in a Forest, Does It Overflow the Stack?
Destructing trees safely and cheaply
Builder Lite
Caches In Rust
Inline In Rust
Newtype Index Pattern
Typed Key Pattern
Encapsulating Lifetime of the Field
Break on named blocks
Temporarily opt-in to shared mutation
Actors with Tokio
The text was updated successfully, but these errors were encountered: