[−][src]Struct exonum::blockchain::ApiSender
Asynchronous sender of messages (transactions by default). The receiver of messages is usually an Exonum node, which then processes them with the consensus algorithm.
Methods
impl<T: Send + 'static> ApiSender<T>
[src]
pub fn new(inner: Sender<T>) -> Self
[src]
Creates new ApiSender
with the given channel.
pub fn closed() -> Self
[src]
Creates a dummy sender which is not connected to anything and thus cannot send messages.
pub async fn send_message<'_>(&'_ mut self, message: T) -> Result<(), SendError>
[src]
Sends a message to the node asynchronously.
Return value
The failure means that the node is being shut down.
pub fn send_message_blocking(&self, message: T) -> Result<(), SendError>
[src]
Sends a message to the node synchronously.
Return value
The failure means that the node is being shut down.
impl ApiSender
[src]
pub fn broadcast_transaction(
&self,
tx: Verified<AnyTx>
) -> impl Future<Output = Result<(), SendError>>
[src]
&self,
tx: Verified<AnyTx>
) -> impl Future<Output = Result<(), SendError>>
Sends a transaction over the channel. If this sender is connected to a node, this will broadcast the transaction to all nodes in the blockchain network.
Return value
The failure means that the node is being shut down.
pub fn broadcast_transaction_blocking(
&self,
tx: Verified<AnyTx>
) -> Result<(), SendError>
[src]
&self,
tx: Verified<AnyTx>
) -> Result<(), SendError>
Sends a transaction over the channel synchronously. If this sender is connected to a node, this will broadcast the transaction to all nodes in the blockchain network.
This is an blocking operation that can take some time if the node is overloaded with requests.
Return value
The failure means that the node is being shut down.
Trait Implementations
impl<T> Clone for ApiSender<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for ApiSender<T>
[src]
Auto Trait Implementations
impl<T = Verified<AnyTx>> !RefUnwindSafe for ApiSender<T>
impl<T> Send for ApiSender<T> where
T: Send,
T: Send,
impl<T> Sync for ApiSender<T> where
T: Send,
T: Send,
impl<T> Unpin for ApiSender<T>
impl<T = Verified<AnyTx>> !UnwindSafe for ApiSender<T>
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,