[−][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]
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
fn get_verified_client_org(&self) -> Result<String, ContractError>
[src]
impl Metadata for AssetContract
[src]
fn get_fn_metadata(&self) -> Vec<TransactionFn>
[src]
impl Routing for AssetContract
[src]
fn route3(
&self,
tx_fn: String,
args: Vec<WireBuffer>,
return_wb: TypeSchema
) -> Result<WireBuffer, ContractError>
[src]
&self,
tx_fn: String,
args: Vec<WireBuffer>,
return_wb: TypeSchema
) -> Result<WireBuffer, ContractError>
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,
fn borrow_mut(&mut self) -> &mut T
[src]
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>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,