Trait sapio::contract::AnyContract [−][src]
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 FinishOrFunc
s.
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.
Required methods
fn then_fns<'a>(&'a self) -> &'a [fn() -> Option<ThenFunc<'a, Self::Ref>>] where
Self::Ref: 'a,
[src]
Self::Ref: 'a,
obtain a reference to the ThenFunc
list.
fn finish_or_fns<'a>(
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, Self::Ref, Self::StatefulArguments>>]
[src]
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, Self::Ref, Self::StatefulArguments>>]
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.
Implementors
impl<C> AnyContract for C where
C: Contract + Sized,
[src]
C: Contract + Sized,
type StatefulArguments = C::StatefulArguments
type Ref = Self
fn then_fns<'a>(&'a self) -> &'a [fn() -> Option<ThenFunc<'a, Self::Ref>>] where
Self::Ref: 'a,
[src]
Self::Ref: 'a,
fn finish_or_fns<'a>(
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, Self::Ref, Self::StatefulArguments>>]
[src]
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, Self::Ref, Self::StatefulArguments>>]
fn finish_fns<'a>(&'a self) -> &'a [fn() -> Option<Guard<Self::Ref>>]
[src]
fn get_inner_ref<'a>(&'a self) -> &Self::Ref
[src]
impl<T, S> AnyContract for DynamicContract<'_, T, S>
[src]
type StatefulArguments = T
type Ref = S
fn then_fns<'a>(&'a self) -> &'a [fn() -> Option<ThenFunc<'a, S>>] where
Self::Ref: 'a,
[src]
Self::Ref: 'a,
fn finish_or_fns<'a>(
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, S, Self::StatefulArguments>>]
[src]
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, S, Self::StatefulArguments>>]