pub struct BitcoindWatcher { /* private fields */ }Implementations§
Source§impl BitcoindWatcher
impl BitcoindWatcher
Sourcepub fn run(&self)
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}Sourcepub fn new(log_path: &str) -> Self
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}Sourcepub fn on_transaction_added_to_mempool(
self,
callback: Box<dyn Fn(LogLine) + 'static>,
) -> Self
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}Sourcepub fn on_new_proof_of_work_valid_block(
self,
callback: Box<dyn Fn(LogLine) + 'static>,
) -> Self
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}Sourcepub fn on_new_outbound_peer_connected(
self,
callback: Box<dyn Fn(LogLine) + 'static>,
) -> Self
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§
impl Freeze for BitcoindWatcher
impl !RefUnwindSafe for BitcoindWatcher
impl !Send for BitcoindWatcher
impl !Sync for BitcoindWatcher
impl Unpin for BitcoindWatcher
impl !UnwindSafe for BitcoindWatcher
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
Mutably borrows from an owned value. Read more