631dc1938c
Refresh IDEAS.md after the ergonomic API pass so the backlog no longer lists implemented items as open work. Split the remaining ideas into deferred and still-open groups to record which omissions were deliberate crate-scope choices. This keeps the project notes aligned with the public API and captures the reasoning for not adding globals, shuffle, or password presets yet. Test Plan: - Not run; documentation-only change. Refs: IDEAS.md ergonomics backlog
1.2 KiB
1.2 KiB
Ergonomy ideas
-
Implemented:
Defaultfor infallible convenience construction.fill_bytes(&mut [u8])convenience so callers don't need to importio::Read.gen_range_<int>for all primitive integer widths.gen_range_<int>_infor standardRangeBoundsforms, includingRangeandRangeInclusive.choose<T>(&[T]) -> &Tfor generic slice selection.Cloneplus fallibletry_clone()so multiple call sites can own separate handles without adding interior mutability.- Presets for direct alphabet names:
OsRandom::token(len),::hex(len), and::pin(len).
-
Deferred to keep the crate small:
thread_localglobal helpers likeez_urandom::random_u64()without constructing or threading anOsRandom.shuffle(&mut [T]);choosecovers the smaller selection use case without growing into collection algorithms.OsRandom::password(len); password generation needs policy decisions about symbols, ambiguous characters, and service-specific constraints.
-
Still open for later consideration:
-
bool()/f64()(unit interval) helpers. -
Accept a
&stralphabet directly (not just&[u8]) and drop the ASCII assert by iteratingchars().