fastrand icon indicating copy to clipboard operation
fastrand copied to clipboard

make rng seed extendable

Open Yneth opened this issue 2 years ago • 2 comments

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
  }
}

Yneth avatar May 15 '22 12:05 Yneth

does this PR make sense to you?

Yneth avatar May 16 '22 21:05 Yneth

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.

fogti avatar Sep 13 '22 12:09 fogti