Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tracking Issue for secure random data generation instd #130703

Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
@joboet

Description

@joboet

Feature gate:#![feature(random)]

This is a tracking issue for secure random data generation support instd.

Central to this feature is theRandomSource trait insidecore::random, which generates random bytes.std also exposes the platform's secure random number generator via theDefaultRandomSource type. There is aDistribution<T> trait for distributions that cansample random values of a specific type, and arandom function for convenience to allow things likerandom(1..=6).

Public API

// core::randompubtraitRandomSource{fnfill_bytes(&mutself,bytes:&mut[u8]);}pubtraitDistribution<T>{fnsample(&self,source:&mut(implRandomSource + ?Sized)) ->T;}implDistribution<bool>forRangeFull{ ...}implDistribution</* all integer types */>for/* all range types */{ ...}// std::random (additionally)pubstructDefaultRandomSource;implRandomSourceforDefaultRandomSource{ ...}pubfnrandom<T>(dist:&(implDistribution<T> + ?Sized)) ->T;

Steps / History

Unresolved Questions

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp