pub struct ExplodingOption<T: 'static> { /* private fields */ }
Expand description

Wraps a generic option opt with functionality to refund both parties on timeout.

Trait Implementations§

source§

impl<T> Contract for ExplodingOption<T>
where GenericBet: TryFrom<T, Error = CompilationError>, T: Clone + 'static,

source§

const THEN_FNS: &'static [fn() -> Option<ThenFuncAsFinishOrFunc<'static, Self, Self::StatefulArguments>>] = _

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.
source§

const FINISH_OR_FUNCS: &'static [fn() -> Option<Box<dyn CallableAsFoF<Self, Self::StatefulArguments>>>] = _

binds the list of FinishOrFunc’s to this impl. Any fn() which returns None is ignored (useful for type-level state machines)
source§

const FINISH_FNS: &'static [fn() -> Option<Guard<Self>>] = _

binds the list of Gurard’s to this impl as unlocking conditions. Guards only need to be bound if it is desired that they are sufficient to unlock funds, a Guard should not be bound if it is intended to be used with a ThenFunc. Any fn() which returns None is ignored (useful for type-level state machines)
source§

fn metadata(&self, _ctx: Context) -> Result<ObjectMetadata, CompilationError>

Generate metadata for this contract object
source§

fn ensure_amount(&self, _ctx: Context) -> Result<Amount, CompilationError>

minimum balance to have in this coin
source§

impl<T> Explodes for ExplodingOption<T>
where GenericBet: TryFrom<T, Error = CompilationError>, T: Clone,

source§

fn explodes<'a>( ) -> Option<ThenFuncAsFinishOrFunc<'a, Self, <Self as Contract>::StatefulArguments>>

(missing docs fix)

source§

fn then_explodes(&self, ctx: Context, _: ThenFuncTypeTag) -> TxTmplIt

(missing docs fix)

source§

fn strikes<'a>( ) -> Option<ThenFuncAsFinishOrFunc<'a, Self, <Self as Contract>::StatefulArguments>>

(missing docs fix)

source§

fn then_strikes(&self, ctx: Context, _: ThenFuncTypeTag) -> TxTmplIt

(missing docs fix)

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for ExplodingOption<T>
where T: RefUnwindSafe,

§

impl<T> Send for ExplodingOption<T>
where T: Send,

§

impl<T> Sync for ExplodingOption<T>
where T: Sync,

§

impl<T> Unpin for ExplodingOption<T>
where T: Unpin,

§

impl<T> UnwindSafe for ExplodingOption<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<'a, T> Compilable for T
where T: AnyContract + 'a, <T as AnyContract>::Ref: 'a,

source§

fn compile(&self, ctx: Context) -> Result<Object, CompilationError>

The main Compilation Logic for a Contract. TODO: Better Document Semantics

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.