[−][src]Struct electrum_client::raw_client::RawClient
Instance of an Electrum client
A Client
maintains a constant connection with an Electrum server and exposes methods to
interact with it. It can also subscribe and receive notifictations from the server about new
blocks or activity on a specific scriptPubKey.
The Client
is modeled in such a way that allows the external caller to have full control over
its functionality: no threads or tasks are spawned internally to monitor the state of the
connection.
More transport methods can be used by manually creating an instance of this struct with an
arbitray S
type.
Implementations
impl RawClient<ElectrumPlaintextStream>
[src]
pub fn new<A: ToSocketAddrs>(
socket_addrs: A,
timeout: Option<Duration>
) -> Result<Self, Error>
[src]
socket_addrs: A,
timeout: Option<Duration>
) -> Result<Self, Error>
Creates a new plaintext client and tries to connect to socket_addr
.
impl RawClient<ElectrumSslStream>
[src]
pub fn new_ssl<A: ToSocketAddrsDomain + Clone>(
socket_addrs: A,
validate_domain: bool,
timeout: Option<Duration>
) -> Result<Self, Error>
[src]
socket_addrs: A,
validate_domain: bool,
timeout: Option<Duration>
) -> Result<Self, Error>
Creates a new SSL client and tries to connect to socket_addr
. Optionally, if
validate_domain
is true
, validate the server's certificate.
pub fn new_ssl_from_stream<A: ToSocketAddrsDomain>(
socket_addr: A,
validate_domain: bool,
tcp_stream: TcpStream
) -> Result<Self, Error>
[src]
socket_addr: A,
validate_domain: bool,
tcp_stream: TcpStream
) -> Result<Self, Error>
Create a new SSL client using an existing TcpStream
impl RawClient<ElectrumProxyStream>
[src]
pub fn new_proxy<T: ToTargetAddr>(
target_addr: T,
proxy: &Socks5Config
) -> Result<Self, Error>
[src]
target_addr: T,
proxy: &Socks5Config
) -> Result<Self, Error>
Creates a new socks client and tries to connect to target_addr
using proxy_addr
as a
socks proxy server. The DNS resolution of target_addr
, if required, is done
through the proxy. This allows to specify, for instance, .onion
addresses.
pub fn new_proxy_ssl<T: ToTargetAddr>(
target_addr: T,
validate_domain: bool,
proxy: &Socks5Config
) -> Result<RawClient<ElectrumSslStream>, Error>
[src]
target_addr: T,
validate_domain: bool,
proxy: &Socks5Config
) -> Result<RawClient<ElectrumSslStream>, Error>
Creates a new TLS client that connects to target_addr
using proxy_addr
as a socks proxy
server. The DNS resolution of target_addr
, if required, is done through the proxy. This
allows to specify, for instance, .onion
addresses.
Trait Implementations
impl<S: Debug> Debug for RawClient<S> where
S: Read + Write,
[src]
S: Read + Write,
impl<T: Read + Write> ElectrumApi for RawClient<T>
[src]
pub fn batch_call(&self, batch: &Batch) -> Result<Vec<Value>, Error>
[src]
pub fn block_headers_subscribe_raw(
&self
) -> Result<RawHeaderNotification, Error>
[src]
&self
) -> Result<RawHeaderNotification, Error>
pub fn block_headers_pop_raw(
&self
) -> Result<Option<RawHeaderNotification>, Error>
[src]
&self
) -> Result<Option<RawHeaderNotification>, Error>
pub fn block_header_raw(&self, height: usize) -> Result<Vec<u8>, Error>
[src]
pub fn block_headers(
&self,
start_height: usize,
count: usize
) -> Result<GetHeadersRes, Error>
[src]
&self,
start_height: usize,
count: usize
) -> Result<GetHeadersRes, Error>
pub fn estimate_fee(&self, number: usize) -> Result<f64, Error>
[src]
pub fn relay_fee(&self) -> Result<f64, Error>
[src]
pub fn script_subscribe(
&self,
script: &Script
) -> Result<Option<ScriptStatus>, Error>
[src]
&self,
script: &Script
) -> Result<Option<ScriptStatus>, Error>
pub fn script_unsubscribe(&self, script: &Script) -> Result<bool, Error>
[src]
pub fn script_pop(&self, script: &Script) -> Result<Option<ScriptStatus>, Error>
[src]
pub fn script_get_balance(
&self,
script: &Script
) -> Result<GetBalanceRes, Error>
[src]
&self,
script: &Script
) -> Result<GetBalanceRes, Error>
pub fn batch_script_get_balance<'s, I>(
&self,
scripts: I
) -> Result<Vec<GetBalanceRes>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
[src]
&self,
scripts: I
) -> Result<Vec<GetBalanceRes>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
pub fn script_get_history(
&self,
script: &Script
) -> Result<Vec<GetHistoryRes>, Error>
[src]
&self,
script: &Script
) -> Result<Vec<GetHistoryRes>, Error>
pub fn batch_script_get_history<'s, I>(
&self,
scripts: I
) -> Result<Vec<Vec<GetHistoryRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
[src]
&self,
scripts: I
) -> Result<Vec<Vec<GetHistoryRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
pub fn script_list_unspent(
&self,
script: &Script
) -> Result<Vec<ListUnspentRes>, Error>
[src]
&self,
script: &Script
) -> Result<Vec<ListUnspentRes>, Error>
pub fn batch_script_list_unspent<'s, I>(
&self,
scripts: I
) -> Result<Vec<Vec<ListUnspentRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
[src]
&self,
scripts: I
) -> Result<Vec<Vec<ListUnspentRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
pub fn transaction_get_raw(&self, txid: &Txid) -> Result<Vec<u8>, Error>
[src]
pub fn batch_transaction_get_raw<'t, I>(
&self,
txids: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
[src]
&self,
txids: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
pub fn batch_block_header_raw<'s, I>(
&self,
heights: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = u32> + Clone,
[src]
&self,
heights: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = u32> + Clone,
pub fn batch_estimate_fee<'s, I>(&self, numbers: I) -> Result<Vec<f64>, Error> where
I: IntoIterator<Item = usize> + Clone,
[src]
I: IntoIterator<Item = usize> + Clone,
pub fn transaction_broadcast_raw(&self, raw_tx: &[u8]) -> Result<Txid, Error>
[src]
pub fn transaction_get_merkle(
&self,
txid: &Txid,
height: usize
) -> Result<GetMerkleRes, Error>
[src]
&self,
txid: &Txid,
height: usize
) -> Result<GetMerkleRes, Error>
pub fn server_features(&self) -> Result<ServerFeaturesRes, Error>
[src]
pub fn ping(&self) -> Result<(), Error>
[src]
pub fn block_header(&self, height: usize) -> Result<BlockHeader, Error>
[src]
pub fn block_headers_subscribe(&self) -> Result<HeaderNotification, Error>
[src]
pub fn block_headers_pop(&self) -> Result<Option<HeaderNotification>, Error>
[src]
pub fn transaction_get(&self, txid: &Txid) -> Result<Transaction, Error>
[src]
pub fn batch_transaction_get<'t, I>(
&self,
txids: I
) -> Result<Vec<Transaction>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
[src]
&self,
txids: I
) -> Result<Vec<Transaction>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
pub fn batch_block_header<I>(
&self,
heights: I
) -> Result<Vec<BlockHeader>, Error> where
I: IntoIterator<Item = u32> + Clone,
[src]
&self,
heights: I
) -> Result<Vec<BlockHeader>, Error> where
I: IntoIterator<Item = u32> + Clone,
pub fn transaction_broadcast(&self, tx: &Transaction) -> Result<Txid, Error>
[src]
impl<S> From<S> for RawClient<S> where
S: Read + Write,
[src]
S: Read + Write,
Auto Trait Implementations
impl<S> RefUnwindSafe for RawClient<S>
[src]
impl<S> Send for RawClient<S> where
S: Send,
[src]
S: Send,
impl<S> Sync for RawClient<S> where
S: Send,
[src]
S: Send,
impl<S> Unpin for RawClient<S>
[src]
impl<S> UnwindSafe for RawClient<S>
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for 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, 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.
pub 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>,