Trait sapio::contract::AnyContract[][src]

pub trait AnyContract where
    Self: Sized
{ type StatefulArguments; type Ref; fn then_fns<'a>(&'a self) -> &'a [fn() -> Option<ThenFunc<'a, Self::Ref>>]
    where
        Self::Ref: 'a
;
fn finish_or_fns<'a>(
        &'a self
    ) -> &'a [fn() -> Option<FinishOrFunc<'a, Self::Ref, Self::StatefulArguments>>];
fn finish_fns<'a>(&'a self) -> &'a [fn() -> Option<Guard<Self::Ref>>];
fn get_inner_ref<'a>(&'a self) -> &'a Self::Ref; }

AnyContract is a generic API for types which can be compiled, encapsulating default static Contracts as well as DynamicContracts/DynamicContractRefs.

This assists in abstracting the layout/internals away from something that can be compiled.

Associated Types

type StatefulArguments[src]

The parameter pack type for FinishOrFuncs.

type Ref[src]

A Reference which can be extracted to the contract argument data For some types, Ref == Self, and for other types Ref may point to a member. This enables DynamicContract and Contract to impl AnyContract, as well as more exotic types.

Loading content...

Required methods

fn then_fns<'a>(&'a self) -> &'a [fn() -> Option<ThenFunc<'a, Self::Ref>>] where
    Self::Ref: 'a, 
[src]

obtain a reference to the ThenFunc list.

fn finish_or_fns<'a>(
    &'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, Self::Ref, Self::StatefulArguments>>]
[src]

obtain a reference to the FinishOrFunc list.

fn finish_fns<'a>(&'a self) -> &'a [fn() -> Option<Guard<Self::Ref>>][src]

obtain a reference to the Guard list.

fn get_inner_ref<'a>(&'a self) -> &'a Self::Ref[src]

obtain a reference to Self::Ref type.

Loading content...

Implementors

impl<C> AnyContract for C where
    C: Contract + Sized
[src]

type StatefulArguments = C::StatefulArguments

type Ref = Self

impl<T, S> AnyContract for DynamicContract<'_, T, S>[src]

type StatefulArguments = T

type Ref = S

Loading content...