programming-team-code / programming_team_code_rust

rustaceans
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

now RMQ op can access variables in outside scope #58

Closed lrvideckis closed 1 month ago

lrvideckis commented 1 month ago

So a fn type can't access anything in surrounding scope, but a closure can.

And Fn is the way to declare the signature of the closure

Using generic types (e.g. F) is a way to store a closure as a struct member

lrvideckis commented 1 month ago

feel free to shoot this one down from previous reasons