Enum dharitri_wasm::types::OptionalArg
source · pub enum OptionalArg<T> {
Some(T),
None,
}Expand description
A smart contract argument or result that can be missing.
If arguments stop before this argument, None will be returned. As an endpoint result, the contract decides if it produces it or not.
As a principle, optional arguments or results should come last, otherwise there is ambiguity as to how to interpret what comes after.
Variants§
Implementations§
source§impl<T> OptionalArg<T>
impl<T> OptionalArg<T>
pub fn into_option(self) -> Option<T>
Trait Implementations§
source§impl<T> ContractCallArg for &OptionalArg<T>where
T: ContractCallArg,
impl<T> ContractCallArg for &OptionalArg<T>where
T: ContractCallArg,
source§impl<T> ContractCallArg for OptionalArg<T>where
T: ContractCallArg,
impl<T> ContractCallArg for OptionalArg<T>where
T: ContractCallArg,
source§impl<T> DynArg for OptionalArg<T>where
T: DynArg,
impl<T> DynArg for OptionalArg<T>where
T: DynArg,
fn dyn_load<I, D>(loader: &mut D, arg_id: ArgId) -> Selfwhere
I: TopDecodeInput,
D: DynArgInput<I>,
source§impl<FA, T> EndpointResult<FA> for OptionalArg<T>
impl<FA, T> EndpointResult<FA> for OptionalArg<T>
source§impl<T> From<Option<T>> for OptionalArg<T>
impl<T> From<Option<T>> for OptionalArg<T>
source§impl<T: TypeAbi> TypeAbi for OptionalArg<T>
impl<T: TypeAbi> TypeAbi for OptionalArg<T>
fn type_name() -> String
source§fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
accumulator: &mut TDC
)
fn provide_type_descriptions<TDC: TypeDescriptionContainer>( accumulator: &mut TDC )
A type can provide more than its own description.
For instance, a struct can also provide the descriptions of the type of its fields.
TypeAbi doesn’t care for the exact accumulator type,
which is abstracted by the TypeDescriptionContainer trait.
Auto Trait Implementations§
impl<T> RefUnwindSafe for OptionalArg<T>where
T: RefUnwindSafe,
impl<T> Send for OptionalArg<T>where
T: Send,
impl<T> Sync for OptionalArg<T>where
T: Sync,
impl<T> Unpin for OptionalArg<T>where
T: Unpin,
impl<T> UnwindSafe for OptionalArg<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more