soroban_sdk::testutils::arbitrary

Trait SorobanArbitrary

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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

Source§

impl<T1> SorobanArbitrary for (T1,)

Source§

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

Source§

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

Source§

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

Source§

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

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>

Source§

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

Implementors§

Source§

impl SorobanArbitrary for Context

Source§

type Prototype = ArbitraryContext

Source§

impl SorobanArbitrary for ContractExecutable

Source§

type Prototype = ArbitraryContractExecutable

Source§

impl SorobanArbitrary for InvokerContractAuthEntry

Source§

type Prototype = ArbitraryInvokerContractAuthEntry

Source§

impl SorobanArbitrary for ContractContext

Source§

type Prototype = ArbitraryContractContext

Source§

impl SorobanArbitrary for CreateContractHostFnContext

Source§

type Prototype = ArbitraryCreateContractHostFnContext

Source§

impl SorobanArbitrary for CreateContractWithConstructorHostFnContext

Source§

type Prototype = ArbitraryCreateContractWithConstructorHostFnContext

Source§

impl SorobanArbitrary for SubContractInvocation

Source§

type Prototype = ArbitrarySubContractInvocation

Source§

impl SorobanArbitrary for Address

Source§

type Prototype = ArbitraryAddress

Source§

impl SorobanArbitrary for Bytes

Source§

type Prototype = ArbitraryBytes

Source§

impl SorobanArbitrary for Duration

Source§

type Prototype = ArbitraryDuration

Source§

impl SorobanArbitrary for I256

Source§

type Prototype = ArbitraryI256

Source§

impl SorobanArbitrary for String

Source§

type Prototype = ArbitraryString

Source§

impl SorobanArbitrary for Symbol

Source§

type Prototype = ArbitrarySymbol

Source§

impl SorobanArbitrary for Timepoint

Source§

type Prototype = ArbitraryTimepoint

Source§

impl SorobanArbitrary for U256

Source§

type Prototype = ArbitraryU256

Source§

impl SorobanArbitrary for Val

Source§

type Prototype = ArbitraryVal

Source§

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

Source§

impl<T> SorobanArbitrary for Vec<T>

Source§

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

Source§

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

Source§

type Prototype = ArbitraryBytesN<N>