pub trait SorobanArbitrary: TryFromVal<Env, Self::Prototype> + IntoVal<Env, Val> + TryFromVal<Env, Val> {
    type Prototype: for<'a> Arbitrary<'a>;
}
Available on crate feature testutils only.
Expand description

An Env-hosted contract value that can be randomly generated.

Types that implement SorabanArbitrary have an associated “prototype” type that implements Arbitrary.

This exists partly so that the prototype can be named like

fuzz_target!(|input: <Bytes as SorobanArbitrary>::Prototype| {
    // ...
});

Required Associated Types§

source

type Prototype: for<'a> Arbitrary<'a>

A type that implements Arbitrary and can be converted to this SorobanArbitrary type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl SorobanArbitrary for bool

source§

impl SorobanArbitrary for i32

source§

impl SorobanArbitrary for i64

source§

impl SorobanArbitrary for i128

source§

impl SorobanArbitrary for u32

source§

impl SorobanArbitrary for u64

source§

impl SorobanArbitrary for u128

source§

impl SorobanArbitrary for ()

source§

impl SorobanArbitrary for Error

§

type Prototype = Error

source§

impl<T1> SorobanArbitrary for (T1,)

§

type Prototype = ArbitraryTuple1<<T1 as SorobanArbitrary>::Prototype>

source§

impl<T1, T2> SorobanArbitrary for (T1, T2)

§

type Prototype = ArbitraryTuple2<<T1 as SorobanArbitrary>::Prototype, <T2 as SorobanArbitrary>::Prototype>

source§

impl<T1, T2, T3> SorobanArbitrary for (T1, T2, T3)

§

type Prototype = ArbitraryTuple3<<T1 as SorobanArbitrary>::Prototype, <T2 as SorobanArbitrary>::Prototype, <T3 as SorobanArbitrary>::Prototype>

source§

impl<T1, T2, T3, T4> SorobanArbitrary for (T1, T2, T3, T4)

source§

impl<T1, T2, T3, T4, T5> SorobanArbitrary for (T1, T2, T3, T4, T5)

source§

impl<T1, T2, T3, T4, T5, T6> SorobanArbitrary for (T1, T2, T3, T4, T5, T6)

source§

impl<T1, T2, T3, T4, T5, T6, T7> SorobanArbitrary for (T1, T2, T3, T4, T5, T6, T7)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> SorobanArbitrary for (T1, T2, T3, T4, T5, T6, T7, T8)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> SorobanArbitrary for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> SorobanArbitrary for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> SorobanArbitrary for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> SorobanArbitrary for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

source§

impl<T> SorobanArbitrary for Option<T>

§

type Prototype = ArbitraryOption<<T as SorobanArbitrary>::Prototype>

Implementors§

source§

impl SorobanArbitrary for Context

§

type Prototype = ArbitraryContext

source§

impl SorobanArbitrary for ContractExecutable

§

type Prototype = ArbitraryContractExecutable

source§

impl SorobanArbitrary for InvokerContractAuthEntry

§

type Prototype = ArbitraryInvokerContractAuthEntry

source§

impl SorobanArbitrary for ContractContext

§

type Prototype = ArbitraryContractContext

source§

impl SorobanArbitrary for CreateContractHostFnContext

§

type Prototype = ArbitraryCreateContractHostFnContext

source§

impl SorobanArbitrary for SubContractInvocation

§

type Prototype = ArbitrarySubContractInvocation

source§

impl SorobanArbitrary for Address

§

type Prototype = ArbitraryAddress

source§

impl SorobanArbitrary for Bytes

§

type Prototype = ArbitraryBytes

source§

impl SorobanArbitrary for Duration

§

type Prototype = ArbitraryDuration

source§

impl SorobanArbitrary for I256

§

type Prototype = ArbitraryI256

source§

impl SorobanArbitrary for String

§

type Prototype = ArbitraryString

source§

impl SorobanArbitrary for Symbol

§

type Prototype = ArbitrarySymbol

source§

impl SorobanArbitrary for Timepoint

§

type Prototype = ArbitraryTimepoint

source§

impl SorobanArbitrary for U256

§

type Prototype = ArbitraryU256

source§

impl SorobanArbitrary for Val

§

type Prototype = ArbitraryVal

source§

impl<K, V> SorobanArbitrary for Map<K, V>

§

type Prototype = ArbitraryMap<<K as SorobanArbitrary>::Prototype, <V as SorobanArbitrary>::Prototype>

source§

impl<T> SorobanArbitrary for Vec<T>

§

type Prototype = ArbitraryVec<<T as SorobanArbitrary>::Prototype>

source§

impl<const N: usize> SorobanArbitrary for BytesN<N>

§

type Prototype = ArbitraryBytesN<N>