Adder

Struct Adder 

Source
pub struct Adder { /* private fields */ }
Expand description

Increments the underlying accumulator value.

Implementations§

Source§

impl Adder

Source

pub fn new(accumulator: AccumulatorRef) -> Self

Creates a new adder from the given accumulator.

Source

pub fn inc(&mut self, by: i32)

Increases the accumulator value by some amount.

Trait Implementations§

Source§

impl ContractAmountDispatchables for Adder

Source§

const MESSAGES: usize = 1usize

The number of dispatchable ink! messages.
Source§

const CONSTRUCTORS: usize = 1usize

The number of dispatchable ink! constructors.
Source§

impl ContractCallBuilder for Adder

Source§

type Type = CallBuilder

The generated contract call builder type.
Source§

impl ContractConstructorDecoder for Adder

Source§

type Type = __ink_ConstructorDecoder

The ink! smart contract constructor decoder type.
Source§

impl ContractDispatchableConstructors</// Increments the underlying `accumulator` value. #[ink(storage)] pub struct Adder { /// The `accumulator` to store the value. accumulator: AccumulatorRef, }> for Adder

Source§

const IDS: [u32; 1]

The sequence stores selector IDs of all ink! constructors dispatchable by the ink! smart contract.
Source§

impl ContractDispatchableMessages</// Increments the underlying `accumulator` value. #[ink(storage)] pub struct Adder { /// The `accumulator` to store the value. accumulator: AccumulatorRef, }> for Adder

Source§

const IDS: [u32; 1]

The sequence stores selector IDs of all ink! messages dispatchable by the ink! smart contract.
Source§

impl ContractEnv for Adder

Source§

type Env = DefaultEnvironment

The environment type.
Source§

impl ContractMessageDecoder for Adder

Source§

type Type = __ink_MessageDecoder

The ink! smart contract message decoder type.
Source§

impl ContractName for Adder

Source§

const NAME: &'static str = "Adder"

The name of the ink! smart contract.
Source§

impl ContractReference for Adder

Source§

type Type = AdderRef

The generated contract reference type.
Source§

impl ContractRootKey for Adder

Source§

impl DispatchableConstructorInfo<2611912030> for Adder

Source§

const CALLABLE: fn(Self::Input) -> Self::Storage = {<{closure@lib.rs:22:9: 26:10} as std::ops::FnOnce<(accumulator::AccumulatorRef,)>>::call_once as fn(<adder::Adder as ink_lang::reflect::DispatchableConstructorInfo<2611912030>>::Input) -> <adder::Adder as ink_lang::reflect::DispatchableConstructorInfo<2611912030>>::Storage}

The closure that can be used to dispatch into the dispatchable ink! constructor.
Source§

const PAYABLE: bool = false

Yields true if the dispatchable ink! constructor is payable.
Source§

const SELECTOR: [u8; 4]

The selectors of the dispatchable ink! constructor.
Source§

const LABEL: &'static str = "new"

The label of the dispatchable ink! constructor.
Source§

type Input = AccumulatorRef

Reflects the input types of the dispatchable ink! constructor.
Source§

type Storage = Adder

The ink! storage struct type.
Source§

impl DispatchableMessageInfo<489841055> for Adder

Source§

const CALLABLE: fn(&mut Self::Storage, Self::Input) -> Self::Output = {<{closure@lib.rs:28:9: 32:10} as std::ops::FnOnce<(&mut adder::Adder, i32)>>::call_once as for<'a> fn(&'a mut <adder::Adder as ink_lang::reflect::DispatchableMessageInfo<489841055>>::Storage, <adder::Adder as ink_lang::reflect::DispatchableMessageInfo<489841055>>::Input) -> <adder::Adder as ink_lang::reflect::DispatchableMessageInfo<489841055>>::Output}

The closure that can be used to dispatch into the dispatchable ink! message. Read more
Source§

const SELECTOR: [u8; 4]

The selectors of the dispatchable ink! message.
Source§

const PAYABLE: bool = false

Yields true if the dispatchable ink! message is payable.
Source§

const MUTATES: bool = true

Yields true if the dispatchable ink! message mutates the ink! storage.
Source§

const LABEL: &'static str = "inc"

The label of the dispatchable ink! message.
Source§

type Input = i32

Reflects the input types of the dispatchable ink! message.
Source§

type Output = ()

Reflects the output type of the dispatchable ink! message.
Source§

type Storage = Adder

The ink! storage struct type.
Source§

impl<'a> Env for &'a Adder

Source§

type EnvAccess = EnvAccess<'a, <Adder as ContractEnv>::Env>

The access wrapper.
Source§

fn env(self) -> Self::EnvAccess

Accesses the host environment with self.env() syntax.
Source§

impl FromAccountId<<Adder as ContractEnv>::Env> for AdderRef

Source§

fn from_account_id( account_id: <<Adder as ContractEnv>::Env as Environment>::AccountId, ) -> Self

Creates the contract instance from the account ID of the already instantiated contract.
Source§

impl SpreadLayout for Adder

Source§

const FOOTPRINT: u64 = 1u64

The footprint of the type. Read more
Source§

const REQUIRES_DEEP_CLEAN_UP: bool = false

Indicates whether a type requires deep clean-up of its state meaning that a clean-up routine has to decode an entity into an instance in order to eventually recurse upon its tear-down. This is not required for the majority of primitive data types such as i32, however types such as storage::Box that might want to forward the clean-up procedure to their inner T require a deep clean-up. Read more
Source§

fn pull_spread(__key_ptr: &mut KeyPtr) -> Self

Pulls an instance of Self from the contract storage. Read more
Source§

fn push_spread(&self, __key_ptr: &mut KeyPtr)

Pushes an instance of Self to the contract storage. Read more
Source§

fn clear_spread(&self, __key_ptr: &mut KeyPtr)

Clears an instance of Self from the contract storage. Read more
Source§

impl<'a> StaticEnv for Adder

Source§

type EnvAccess = EnvAccess<'static, <Adder as ContractEnv>::Env>

The access wrapper.
Source§

fn env() -> Self::EnvAccess

Accesses the host environment with Self::env() syntax.
Source§

impl StorageLayout for Adder

Source§

fn layout(__key_ptr: &mut KeyPtr) -> Layout

Returns the static storage layout of Self. Read more
Source§

impl ToAccountId<<Adder as ContractEnv>::Env> for AdderRef

Source§

fn to_account_id( &self, ) -> <<Adder as ContractEnv>::Env as Environment>::AccountId

Returns the underlying account identifier of the instantiated contract.

Auto Trait Implementations§

§

impl Freeze for Adder

§

impl RefUnwindSafe for Adder

§

impl Send for Adder

§

impl Sync for Adder

§

impl Unpin for Adder

§

impl UnwindSafe for Adder

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<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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> JsonSchemaMaybe for T