[][src]Struct activeledger::Transaction

pub struct Transaction { /* fields omitted */ }

Transaction struct

Methods

impl Transaction[src]

pub fn new(tx_data: &str) -> Transaction[src]

Create a new transaction object

Takes a JSON string

The active_txbuilder crate can be used to generate the transaction data

Example

let tx = Transaction::new("{TX DATA HERE}");

Expected JSON structure

{
    "$territoriality" : "" // Optional
    "$tx" : {
        "$namespace":"",
        "$contract":"",
        "$entry":"",
        "$i":"",
        "$o":"" // Optional
        "$r":"" // Optional
    },
    "$selfsign" : true, // Optional
    "$sigs" : {
        "<identity>" : "<signature>"
    }
}

More information about transaction data can be found in the Activeledger documentation here.

pub fn get_data(&self) -> &str[src]

Get the transaction data

Returns a string reference

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

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

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