Struct electrum_client::Batch

source ·
pub struct Batch { /* private fields */ }
Expand description

Helper structure that caches all the requests before they are actually sent to the server.

Calls on this function are stored and run when batch_call is run on a Client.

This structure can be used to make multiple different calls in one single run. For batch calls of the same type, there are shorthands methods defined on the Client, like batch_script_get_balance to ask the server for the balance of multiple scripts with a single request.

Implementations§

source§

impl Batch

source

pub fn script_list_unspent(&mut self, script: &Script)

Add one blockchain.scripthash.listunspent request to the batch queue

source

pub fn script_get_history(&mut self, script: &Script)

Add one blockchain.scripthash.get_history request to the batch queue

source

pub fn script_get_balance(&mut self, script: &Script)

Add one blockchain.scripthash.get_balance request to the batch queue

source

pub fn transaction_get(&mut self, tx_hash: &Txid)

Add one blockchain.transaction.get request to the batch queue

source

pub fn estimate_fee(&mut self, number: usize)

Add one blockchain.estimatefee request to the batch queue

source

pub fn block_header(&mut self, height: u32)

Add one blockchain.block.get_header request to the batch queue

source

pub fn iter(&self) -> BatchIter<'_>

Returns an iterator on the batch

Trait Implementations§

source§

impl Default for Batch

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl IntoIterator for Batch

§

type Item = (String, Vec<Param, Global>)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<<Batch as IntoIterator>::Item, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Batch

§

impl Send for Batch

§

impl Sync for Batch

§

impl Unpin for Batch

§

impl UnwindSafe for Batch

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.