feat: Add std support for no-std without global rand seed#169
feat: Add std support for no-std without global rand seed#169Xuanwo merged 14 commits intoXuanwo:mainfrom
Conversation
backon/src/backoff/mod.rs
Outdated
| pub use exponential::ExponentialBackoff; | ||
| pub use exponential::ExponentialBuilder; | ||
|
|
||
| trait Random { |
There was a problem hiding this comment.
Hi, I don't want to introduce a new trait for this. Maybe we can store a new fastrand::Rng in every FibonacciBackoff?
|
Because of jitter, a random source is needed in all three Backoff Objects. That is why I used the trait. It is not just the FibonacciBackoff that needs randomness. Considering this, I think it makes sense to use a trait in order to avoid duplication. But please, tell me how you want to proceed. |
|
Reduced use of alloc to tests, this makes backon even better suitable for no_std |
Thank you for the explanation.
I think we can store a With this change, we no longer need to differentiate between |
|
I removed the trait and integrated the Rng as you suggested. Does this meet your expectations? |
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you @wackazong for this! It mostly aligns with what I expected, with only a few minor suggestions.
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you @wackazong a lot for working on this. The only thing left is to address the merge conflicts.
|
Hi @wackazong, the conflict persists even after |
|
Ok, got it now. |
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you @wackazong, let's move!
Split Xuanwo#168 into two PRs as requested, this is the one for no_std support. --------- Co-authored-by: Xuanwo <github@xuanwo.io>
Split Xuanwo#168 into two PRs as requested, this is the one for no_std support. --------- Co-authored-by: Xuanwo <github@xuanwo.io>
Split #168 into two PRs as requested, this is the one for no_std support.