[][src]Struct electrum_client::raw_client::RawClient

pub struct RawClient<S> where
    S: Read + Write
{ /* fields omitted */ }

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]

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]

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]

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]

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]

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]

impl<T: Read + Write> ElectrumApi for RawClient<T>[src]

impl<S> From<S> for RawClient<S> where
    S: Read + Write
[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for RawClient<S>[src]

impl<S> Send for RawClient<S> where
    S: Send
[src]

impl<S> Sync for RawClient<S> where
    S: Send
[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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]

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.