[Question] purpose of eventually-util::optional::Aggregate #163
-
|
hi there! I'm just curious what use-case/problem is solved with the It seems to me that this trait is meant to be an analogue of the regular Would it be cleaner to simply add a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
Hey there! The Specifically, the You could still use the base |
Beta Was this translation helpful? Give feedback.
Hey there!
The
optional::Aggregatetrait is meant to provide a nicer API for Aggregate states that can be optional (which is probably 99.99% of cases btw).Specifically, the
*_firstand*_nextmethods are an alternative of doing pattern matching on the value ofState.You could still use the base
Aggregatetrait, this is just a zero-cost abstraction :)