[][src]Struct basic_contract_rs::AssetContract

pub struct AssetContract {}

Structure for the AssetContract, on which implemenation transaction functions will be added

Implementations

impl AssetContract[src]

The contract implementation Should be marked with the macro #[contrant_impl]

All transactions functions should have the #[Transaction(evaluate)] or #[Transaction(submit)] This indicates that the function should be submitted (sent for endorsing to all peers) or is a query operation, that does not need to be written to the ledger.

pub fn new() -> AssetContract[src]

Some form of 'new' function is required. See the lib.rs of this example for how this is used.

pub fn asset_exists(&self, asset_id: String) -> Result<bool, ContractError>[src]

Does the Asset with the supplied key exist?

Returns true or false or ContractError

pub fn create_asset(
    &self,
    my_assset_id: String,
    value: String
) -> Result<(), ContractError>
[src]

Creates a new asset, with supplied id, and value Marked as submit as this updates the ledger

pub fn read_asset_value(
    &self,
    my_assset_id: String
) -> Result<String, ContractError>
[src]

Reads the value with the supplied asset id

Returns the string value

pub fn count_assets(&self) -> Result<String, ContractError>[src]

pub fn the_answer(&self) -> Result<i32, ContractError>[src]

Trait Implementations

impl Contract for AssetContract[src]

Implementation of the contract trait for the AssetContract There are default implementation methods, for after, before and unknownTransaction

Recommended that the name() function is always modified

fn name(&self) -> String[src]

Name of the contract

impl Metadata for AssetContract[src]

impl Routing for AssetContract[src]

Auto Trait Implementations

impl RefUnwindSafe for AssetContract

impl Send for AssetContract

impl Sync for AssetContract

impl Unpin for AssetContract

impl UnwindSafe for AssetContract

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.