pub struct ChainToPoolAndNetAdapter<B, P>where
B: BlockChain,
P: PoolAdapter,{ /* private fields */ }Expand description
Implementation of the ChainAdapter for the network. Gets notified when the accepted a new block, asking the pool to update its state and the network to broadcast the block
Implementations§
Source§impl<B, P> ChainToPoolAndNetAdapter<B, P>where
B: BlockChain,
P: PoolAdapter,
impl<B, P> ChainToPoolAndNetAdapter<B, P>where
B: BlockChain,
P: PoolAdapter,
Sourcepub fn new(
tx_pool: Arc<RwLock<TransactionPool<B, P>>>,
hooks: Vec<Box<dyn ChainEvents + Send + Sync>>,
) -> Self
pub fn new( tx_pool: Arc<RwLock<TransactionPool<B, P>>>, hooks: Vec<Box<dyn ChainEvents + Send + Sync>>, ) -> Self
Construct a ChainToPoolAndNetAdapter instance.
Trait Implementations§
Source§impl<B, P> ChainAdapter for ChainToPoolAndNetAdapter<B, P>where
B: BlockChain,
P: PoolAdapter,
impl<B, P> ChainAdapter for ChainToPoolAndNetAdapter<B, P>where
B: BlockChain,
P: PoolAdapter,
Source§fn block_accepted(&self, b: &Block, status: BlockStatus, opts: Options)
fn block_accepted(&self, b: &Block, status: BlockStatus, opts: Options)
The blockchain pipeline has accepted this block as valid and added
it to our chain.
Auto Trait Implementations§
impl<B, P> Freeze for ChainToPoolAndNetAdapter<B, P>
impl<B, P> !RefUnwindSafe for ChainToPoolAndNetAdapter<B, P>
impl<B, P> Send for ChainToPoolAndNetAdapter<B, P>
impl<B, P> Sync for ChainToPoolAndNetAdapter<B, P>
impl<B, P> Unpin for ChainToPoolAndNetAdapter<B, P>
impl<B, P> !UnwindSafe for ChainToPoolAndNetAdapter<B, P>
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