Iterators are a means of abstraction over sequences and define a pattern for consuming sequences. In Rust, iterators are…
The state pattern is a behavioral design pattern that allows an object to alter its behavior when its internal…
this is an attempt to use Java style strategy dispatch in rust
The strategy pattern is a behavioral design pattern that turns a set of behaviors into objects and makes them interchangeable inside original context object.
Since rust is static typed language, writing code that works for multiple types needs a way to support it. Eighter macros or Generics. Here lets consider binary search implementation: