[][src]Struct exonum_rust_runtime::Broadcaster

pub struct Broadcaster<'a> { /* fields omitted */ }

Transaction broadcaster.

Transaction broadcast allows a service to create transactions in the after_commit handler or the HTTP API handlers and broadcast them to the connected Exonum nodes. The transactions are addressed to the executing service instance and are signed by the service keypair of the node.

Broadcasting functionality is primarily useful for services that receive information from outside the blockchain and need to translate it to transactions. As an example, a time oracle service may broadcast local node time and build the blockchain-wide time by processing corresponding transactions.

Methods

impl<'a> Broadcaster<'a>[src]

pub fn into_owned(self) -> Broadcaster<'static>[src]

Converts the broadcaster into the owned representation, which can be used to broadcast transactions asynchronously.

Trait Implementations

impl<'a> Clone for Broadcaster<'a>[src]

impl<'a> Debug for Broadcaster<'a>[src]

impl<'_> GenericCall<()> for Broadcaster<'_>[src]

Signs and broadcasts a transaction to the other nodes in the network.

The transaction is signed by the service keypair of the node. The same input transaction will lead to the identical transaction being broadcast. If this is undesired, add a nonce field to the input transaction (e.g., a u64) and change it between the calls.

Return value

Returns the hash of the created transaction, or an error if the transaction cannot be broadcast. An error means that the node is being shut down.

type Output = Result<Hash, SendError>

Type of values output by the stub.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Broadcaster<'a>

impl<'a> Send for Broadcaster<'a>

impl<'a> Sync for Broadcaster<'a>

impl<'a> Unpin for Broadcaster<'a>

impl<'a> !UnwindSafe for Broadcaster<'a>

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> Erased for T

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,