[][src]Struct transact::sawtooth::SawtoothToTransactHandlerAdapter

pub struct SawtoothToTransactHandlerAdapter<H: SawtoothTransactionHandler + Send> { /* fields omitted */ }

Adapts a Sawtooth Transaction Handler to a Transact TransactionHandler.

This adapter allows Sawtooth SDK TransactionHandler implementations to be used with the Transact static execution adapters. Existing Sawtooth transaction families and smart contract engines can then be compiled in to an application using Transact.

For example, the Sawtooth transaction handler for the XO Transaction Family can be adapted as follows:

let execution_adapter = StaticExecutionAdapter::new_adapter(
    vec![Box::new(SawtoothToTransactHandlerAdapter::new(
        XoTransactionHandler::new(),
    ))],
    context_manager,
);

Methods

impl<H: SawtoothTransactionHandler + Send> SawtoothToTransactHandlerAdapter<H>[src]

pub fn new(handler: H) -> Self[src]

Constructs a new Sawtooth to Transact handler adapter.

Trait Implementations

impl<H: SawtoothTransactionHandler + Send> TransactionHandler for SawtoothToTransactHandlerAdapter<H>[src]

Auto Trait Implementations

impl<H> RefUnwindSafe for SawtoothToTransactHandlerAdapter<H> where
    H: RefUnwindSafe

impl<H> Send for SawtoothToTransactHandlerAdapter<H>

impl<H> Sync for SawtoothToTransactHandlerAdapter<H> where
    H: Sync

impl<H> Unpin for SawtoothToTransactHandlerAdapter<H> where
    H: Unpin

impl<H> UnwindSafe for SawtoothToTransactHandlerAdapter<H> where
    H: UnwindSafe

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> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

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.