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: Clone> Clone for OptionalArg<T>
impl<T: Clone> Clone for OptionalArg<T>
source§fn clone(&self) -> OptionalArg<T>
fn clone(&self) -> OptionalArg<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<T> ContractCallArg for &OptionalArg<T>where
T: ContractCallArg,
impl<T> ContractCallArg for &OptionalArg<T>where
T: ContractCallArg,
fn push_dyn_arg<O: DynArgOutput>(&self, output: &mut O)
source§impl<T> ContractCallArg for OptionalArg<T>where
T: ContractCallArg,
impl<T> ContractCallArg for OptionalArg<T>where
T: ContractCallArg,
fn push_dyn_arg<O: DynArgOutput>(&self, output: &mut O)
source§impl<T> DynArg for OptionalArg<T>where
T: DynArg,
impl<T> DynArg for OptionalArg<T>where
T: DynArg,
source§impl<T> EndpointResult for OptionalArg<T>where
T: EndpointResult,
impl<T> EndpointResult for OptionalArg<T>where
T: EndpointResult,
§type DecodeAs = OptionalArg<<T as EndpointResult>::DecodeAs>
type DecodeAs = OptionalArg<<T as EndpointResult>::DecodeAs>
Indicates how the result of the endpoint can be interpreted when called via proxy.
Self for most types.fn finish<FA>(&self)where
FA: ManagedTypeApi + EndpointFinishApi,
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