Struct sapio_contrib::contracts::dynamic::DynamicExample [−][src]
Shows how to make a Dynamic Contract without creating a bespoke type.
Trait Implementations
impl Contract for DynamicExample
[src]
const THEN_FNS: &'static [fn() -> Option<ThenFunc<'static, Self>>]
[src]
binds the list of ThenFunc
’s to this impl.
Any fn() which returns None is ignored (useful for type-level state machines)
type StatefulArguments = ()
Due to type system limitations, all FinishOrFuncs
for a Contract type must share a
parameter pack type. If stable, no default type allowed. Read more
pub const FINISH_OR_FUNCS: &'static [fn() -> Option<FinishOrFunc<'static, Self, Self::StatefulArguments>>]
[src]
pub const FINISH_FNS: &'static [fn() -> Option<Guard<Self>>]
[src]
impl<'de> Deserialize<'de> for DynamicExample
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl JsonSchema for DynamicExample
[src]
fn schema_name() -> String
[src]
fn json_schema(gen: &mut SchemaGenerator) -> Schema
[src]
pub fn is_referenceable() -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for DynamicExample
impl Send for DynamicExample
impl Sync for DynamicExample
impl Unpin for DynamicExample
impl UnwindSafe for DynamicExample
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<C> AnyContract for C where
C: Contract,
[src]
C: Contract,
type StatefulArguments = <C as Contract>::StatefulArguments
The parameter pack type for FinishOrFunc
s.
type Ref = C
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. Read more
pub fn then_fns<'a>(
&'a self
) -> &'a [fn() -> Option<ThenFunc<'a, <C as AnyContract>::Ref>>] where
<C as AnyContract>::Ref: 'a,
[src]
&'a self
) -> &'a [fn() -> Option<ThenFunc<'a, <C as AnyContract>::Ref>>] where
<C as AnyContract>::Ref: 'a,
pub fn finish_or_fns(
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, <C as AnyContract>::Ref, <C as AnyContract>::StatefulArguments>>]
[src]
&'a self
) -> &'a [fn() -> Option<FinishOrFunc<'a, <C as AnyContract>::Ref, <C as AnyContract>::StatefulArguments>>]
pub fn finish_fns(
&'a self
) -> &'a [fn() -> Option<Guard<<C as AnyContract>::Ref>>]
[src]
&'a self
) -> &'a [fn() -> Option<Guard<<C as AnyContract>::Ref>>]
pub fn get_inner_ref(&'a self) -> &'a <C as AnyContract>::Ref
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Compilable for T where
T: AnyContract + 'a,
<T as AnyContract>::Ref: 'a,
[src]
T: AnyContract + 'a,
<T as AnyContract>::Ref: 'a,
pub fn compile(&self, ctx: &Context) -> Result<Object, CompilationError>
[src]
The main Compilation Logic for a Contract. TODO: Better Document Semantics
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,