BitcoindWatcher

Struct BitcoindWatcher 

Source
pub struct BitcoindWatcher { /* private fields */ }

Implementations§

Source§

impl BitcoindWatcher

Source

pub fn run(&self)

Examples found in repository?
examples/example.rs (line 25)
6fn main() {
7    type Callback = Box<dyn Fn(LogLine) + 'static>;
8
9    let on_transaction_added_to_mempool: Callback = Box::new(|log_line| {
10        println!(".....on_transaction_added_to_mempool.....");
11        println!("{:?}", log_line)
12    });
13    let on_new_proof_of_work_valid_block: Callback = Box::new(|log_line| {
14        println!(".....on_new_proof_of_work_valid_block.....");
15        println!("{:?}", log_line)
16    });
17    let on_new_outbound_peer_connected: Callback = Box::new(|log_line| {
18        println!(".....on_new_outbound_peer_connected.....");
19        println!("{:?}", log_line)
20    });
21    BitcoindWatcher::new(FILE_TO_WATCH)
22        .on_transaction_added_to_mempool(on_transaction_added_to_mempool)
23        .on_new_proof_of_work_valid_block(on_new_proof_of_work_valid_block)
24        .on_new_outbound_peer_connected(on_new_outbound_peer_connected)
25        .run();
26}
Source

pub fn new(log_path: &str) -> Self

Examples found in repository?
examples/example.rs (line 21)
6fn main() {
7    type Callback = Box<dyn Fn(LogLine) + 'static>;
8
9    let on_transaction_added_to_mempool: Callback = Box::new(|log_line| {
10        println!(".....on_transaction_added_to_mempool.....");
11        println!("{:?}", log_line)
12    });
13    let on_new_proof_of_work_valid_block: Callback = Box::new(|log_line| {
14        println!(".....on_new_proof_of_work_valid_block.....");
15        println!("{:?}", log_line)
16    });
17    let on_new_outbound_peer_connected: Callback = Box::new(|log_line| {
18        println!(".....on_new_outbound_peer_connected.....");
19        println!("{:?}", log_line)
20    });
21    BitcoindWatcher::new(FILE_TO_WATCH)
22        .on_transaction_added_to_mempool(on_transaction_added_to_mempool)
23        .on_new_proof_of_work_valid_block(on_new_proof_of_work_valid_block)
24        .on_new_outbound_peer_connected(on_new_outbound_peer_connected)
25        .run();
26}
Source

pub fn on_transaction_added_to_mempool( self, callback: Box<dyn Fn(LogLine) + 'static>, ) -> Self

Examples found in repository?
examples/example.rs (line 22)
6fn main() {
7    type Callback = Box<dyn Fn(LogLine) + 'static>;
8
9    let on_transaction_added_to_mempool: Callback = Box::new(|log_line| {
10        println!(".....on_transaction_added_to_mempool.....");
11        println!("{:?}", log_line)
12    });
13    let on_new_proof_of_work_valid_block: Callback = Box::new(|log_line| {
14        println!(".....on_new_proof_of_work_valid_block.....");
15        println!("{:?}", log_line)
16    });
17    let on_new_outbound_peer_connected: Callback = Box::new(|log_line| {
18        println!(".....on_new_outbound_peer_connected.....");
19        println!("{:?}", log_line)
20    });
21    BitcoindWatcher::new(FILE_TO_WATCH)
22        .on_transaction_added_to_mempool(on_transaction_added_to_mempool)
23        .on_new_proof_of_work_valid_block(on_new_proof_of_work_valid_block)
24        .on_new_outbound_peer_connected(on_new_outbound_peer_connected)
25        .run();
26}
Source

pub fn on_new_proof_of_work_valid_block( self, callback: Box<dyn Fn(LogLine) + 'static>, ) -> Self

Examples found in repository?
examples/example.rs (line 23)
6fn main() {
7    type Callback = Box<dyn Fn(LogLine) + 'static>;
8
9    let on_transaction_added_to_mempool: Callback = Box::new(|log_line| {
10        println!(".....on_transaction_added_to_mempool.....");
11        println!("{:?}", log_line)
12    });
13    let on_new_proof_of_work_valid_block: Callback = Box::new(|log_line| {
14        println!(".....on_new_proof_of_work_valid_block.....");
15        println!("{:?}", log_line)
16    });
17    let on_new_outbound_peer_connected: Callback = Box::new(|log_line| {
18        println!(".....on_new_outbound_peer_connected.....");
19        println!("{:?}", log_line)
20    });
21    BitcoindWatcher::new(FILE_TO_WATCH)
22        .on_transaction_added_to_mempool(on_transaction_added_to_mempool)
23        .on_new_proof_of_work_valid_block(on_new_proof_of_work_valid_block)
24        .on_new_outbound_peer_connected(on_new_outbound_peer_connected)
25        .run();
26}
Source

pub fn on_new_outbound_peer_connected( self, callback: Box<dyn Fn(LogLine) + 'static>, ) -> Self

Examples found in repository?
examples/example.rs (line 24)
6fn main() {
7    type Callback = Box<dyn Fn(LogLine) + 'static>;
8
9    let on_transaction_added_to_mempool: Callback = Box::new(|log_line| {
10        println!(".....on_transaction_added_to_mempool.....");
11        println!("{:?}", log_line)
12    });
13    let on_new_proof_of_work_valid_block: Callback = Box::new(|log_line| {
14        println!(".....on_new_proof_of_work_valid_block.....");
15        println!("{:?}", log_line)
16    });
17    let on_new_outbound_peer_connected: Callback = Box::new(|log_line| {
18        println!(".....on_new_outbound_peer_connected.....");
19        println!("{:?}", log_line)
20    });
21    BitcoindWatcher::new(FILE_TO_WATCH)
22        .on_transaction_added_to_mempool(on_transaction_added_to_mempool)
23        .on_new_proof_of_work_valid_block(on_new_proof_of_work_valid_block)
24        .on_new_outbound_peer_connected(on_new_outbound_peer_connected)
25        .run();
26}

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.