[−][src]Struct fabric_contract::blockchain::TransactionContext
Represents a transaction
This can be used to obtain information about the current transaction that trigger a contract function to be executed.
Timestamp and MSPID are two important fields
Example
pub fn myTransactionFn(){ let tx = fabric_contract::blockchain::TransactionContext::current_transaction(); let id = tx.get_id(); let timestamp = tx.get_timestamp(); let mspid = tx.get_peer_mspid(); }
Implementations
impl TransactionContext
[src]
pub fn new(ctx: &TxCtx) -> TransactionContext
[src]
pub fn get_id(&self) -> String
[src]
Gets the transaction id
Full transaction id
pub fn get_timestamp(&self) -> String
[src]
Gets the timestamp of this transaction
Format is ISO - need better type here
pub fn get_channelid(&self) -> String
[src]
pub fn get_peer_mspid(&self) -> String
[src]
The MSP Identifier of the originating organization
pub fn get_submitting_identity(&self) -> Result<ClientIdentity, String>
[src]
Get
pub fn current_transaction() -> TransactionContext
[src]
Get the current transaction
Trait Implementations
impl Clone for TransactionContext
[src]
fn clone(&self) -> TransactionContext
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for TransactionContext
[src]
fn default() -> TransactionContext
[src]
Auto Trait Implementations
impl RefUnwindSafe for TransactionContext
impl Send for TransactionContext
impl Sync for TransactionContext
impl Unpin for TransactionContext
impl UnwindSafe for TransactionContext
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,