[−][src]Struct basic_contract_rs::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][−]
&self,
my_assset_id: String,
value: String
) -> Result<(), ContractError>
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][−]
&self,
my_assset_id: String
) -> Result<String, ContractError>
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][+]
fn name(&self) -> String
[src][−]
fn get_verified_client_org(&self) -> Result<String, ContractError>
[src][−]
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][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,