MCPcopy Create free account
hub / github.com/bitflags/bitflags / arbitrary

Function arbitrary

src/external/arbitrary.rs:8–13  ·  view source on GitHub ↗

Generate some arbitrary flags value with only known bits set. */

(u: &mut arbitrary::Unstructured<'a>)

Source from the content-addressed store, hash-verified

6Generate some arbitrary flags value with only known bits set.
7*/
8pub fn arbitrary<'a, B: Flags>(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<B>
9where
10 B::Bits: arbitrary::Arbitrary<'a>,
11{
12 B::from_bits(u.arbitrary()?).ok_or(arbitrary::Error::IncorrectFormat)
13}
14
15#[cfg(test)]
16mod tests {

Callers 1

test_arbitraryFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_arbitraryFunction · 0.68