Examples of useful Rust patterns.
Detects whether T implements certain traits.
When to use:
- You want to know at runtime whether a type implements certain traits.
A workaround for self-referential types.
When to use:
- You need to work with a type such as
&'a Type<'a>.
Creating a trait object from a trait with generic methods.
When to use:
- You want to create a trait object from a trait that has generic methods.
- The generic methods require a
'staticlifetime, as infoo<T: 'static>().
When to use:
- You want to manage functions with different signatures in a single collection.
- You need to call those functions from your code.
When to use:
- You want to see how to implement an ECS using systems and queries.
When to use:
- You want to use Web Workers and bundle your JavaScript and WASM with Vite.