fastrand
fastrand copied to clipboard
make rng seed extendable
Cell
is not Send
thus it cannot be used as struct field in async environment.
I tried to implement cursor, which needs to have its' data shuffled in a deterministic manner.
example:
struct Cursor {
idx: usize,
buf: Vec<T>,
rng: Rng,
seed: u64
}
impl Cursor {
async fn next() {
// when idx > buf.len(), refresh, shuffle, continue
}
}
does this PR make sense to you?
As mentioned in #31 it might be more beneficial to get rid of interior mutability altogether and instead let the user wrap it in whatever interior mutability abstraction they want to use.