Crate arbitrary_with

Source
Expand description

§arbitrary_with

docs.rs crates.io

serde_with analog for arbitrary

§Example

#[derive(Arbitrary)]
struct A {
    #[arbitrary(with = As::<Option<DisplayFromStr<i32>>>::arbitrary)]
    n: Option<String>,
};

let a: A = u.arbitrary()?;
if let Some(n) = a.n {
    let _i: i32 = n.parse().unwrap();
}

Re-exports§

pub use arbitrary;

Modules§

size_hint
Utilities for working with and combining the results of Arbitrary::size_hint.
unstructured
Wrappers around raw, unstructured bytes.

Structs§

As
AsWrap
Helper to implement Arbitrary trait for adapters
DisplayFromStr
FromInto
LimitLen
MaxRecursionReached
Error indicating that the maximum recursion depth has been reached while calculating Arbitrary::size_hint
Same
Unstructured
A source of unstructured data.

Enums§

Error
An enumeration of buffer creation errors

Traits§

Arbitrary
Generate arbitrary structured values from raw, unstructured data.
ArbitraryAs
UnstructuredExt

Type Aliases§

Result
A Result with the error type fixed as arbitrary::Error.