pub struct Forwarder { /* private fields */ }Implementations§
Source§impl Forwarder
impl Forwarder
pub fn new(sources: Vec<String>, timeout: Duration) -> Forwarder
Sourcepub fn node_server_info(self: &Arc<Self>) -> Option<Map<String, Value>>
pub fn node_server_info(self: &Arc<Self>) -> Option<Map<String, Value>>
The node’s server_info, for the fields merged into ours. Never waits for
a node: a client’s server_info is answered from our own data, and with
every node silent, waiting would outlast a client’s timeout. Returns the
last answer if it is younger than INFO_KEEP, and once it is older than
CACHE_FOR, or there is none, refreshes it in the background.
Sourcepub fn forward(
&self,
method: &str,
params: &Map<String, Value>,
) -> Result<Map<String, Value>, RpcError>
pub fn forward( &self, method: &str, params: &Map<String, Value>, ) -> Result<Map<String, Value>, RpcError>
result of the node’s response. An error from the node itself (status: error)
is returned as is, since it is an answer to the request; all nodes down gives failedToForward.
Sourcepub fn send_transaction(
&self,
params: &Map<String, Value>,
) -> Result<Map<String, Value>, RpcError>
pub fn send_transaction( &self, params: &Map<String, Value>, ) -> Result<Map<String, Value>, RpcError>
Sends a signed transaction to one node. Unlike forward this is never
cached: a retry has to reach the network. Another node is asked only when
the first can’t have received it. Sending it again after a timeout could
give tefPAST_SEQ for a transaction that in fact went through, and the
client would take that for a failure; so it gets failedToForward and
must look the transaction up by hash.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Forwarder
impl !RefUnwindSafe for Forwarder
impl !UnwindSafe for Forwarder
impl Send for Forwarder
impl Sync for Forwarder
impl Unpin for Forwarder
impl UnsafeUnpin for Forwarder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].