Struct openethereum::informant::Informant
source · [−]pub struct Informant<T> {
last_tick: RwLock<Instant>,
with_color: bool,
target: T,
snapshot: Option<Arc<SnapshotService>>,
rpc_stats: Option<Arc<RpcStats>>,
last_import: Mutex<Instant>,
skipped: AtomicUsize,
skipped_txs: AtomicUsize,
in_shutdown: AtomicBool,
last_report: Mutex<ClientReport>,
}
Fields
last_tick: RwLock<Instant>
with_color: bool
target: T
snapshot: Option<Arc<SnapshotService>>
rpc_stats: Option<Arc<RpcStats>>
last_import: Mutex<Instant>
skipped: AtomicUsize
skipped_txs: AtomicUsize
in_shutdown: AtomicBool
last_report: Mutex<ClientReport>
Implementations
sourceimpl<T: InformantData> Informant<T>
impl<T: InformantData> Informant<T>
Trait Implementations
sourceimpl ChainNotify for Informant<FullNodeInformantData>
impl ChainNotify for Informant<FullNodeInformantData>
sourcefn new_blocks(&self, new_blocks: NewBlocks)
fn new_blocks(&self, new_blocks: NewBlocks)
fires when chain has new blocks.
sourcefn broadcast(&self, _message_type: ChainMessageType)
fn broadcast(&self, _message_type: ChainMessageType)
fires when chain broadcasts a message
sourcefn block_pre_import(
&self,
_bytes: &Vec<u8, Global>,
_hash: &H256,
_difficulty: &U256
)
fn block_pre_import(
&self,
_bytes: &Vec<u8, Global>,
_hash: &H256,
_difficulty: &U256
)
fires when new block is about to be imported implementations should be light Read more
sourcefn transactions_received(&self, _txs: &[UnverifiedTransaction], _peer_id: usize)
fn transactions_received(&self, _txs: &[UnverifiedTransaction], _peer_id: usize)
fires when new transactions are received from a peer
sourceimpl<T: InformantData> IoHandler<ClientIoMessage> for Informant<T>
impl<T: InformantData> IoHandler<ClientIoMessage> for Informant<T>
sourcefn initialize(&self, io: &IoContext<ClientIoMessage>)
fn initialize(&self, io: &IoContext<ClientIoMessage>)
Initialize the handler
sourcefn timeout(&self, _io: &IoContext<ClientIoMessage>, timer: TimerToken)
fn timeout(&self, _io: &IoContext<ClientIoMessage>, timer: TimerToken)
Timer function called after a timeout created with HandlerIo::timeout
.
sourcefn message(&self, _io: &IoContext<Message>, _message: &Message)
fn message(&self, _io: &IoContext<Message>, _message: &Message)
Called when a broadcasted message is received. The message can only be sent from a different IO handler.
sourcefn stream_hup(&self, _io: &IoContext<Message>, _stream: usize)
fn stream_hup(&self, _io: &IoContext<Message>, _stream: usize)
Called when an IO stream gets closed
sourcefn stream_readable(&self, _io: &IoContext<Message>, _stream: usize)
fn stream_readable(&self, _io: &IoContext<Message>, _stream: usize)
Called when an IO stream can be read from
sourcefn stream_writable(&self, _io: &IoContext<Message>, _stream: usize)
fn stream_writable(&self, _io: &IoContext<Message>, _stream: usize)
Called when an IO stream can be written to
sourcefn register_stream(
&self,
_stream: usize,
_reg: Token,
_event_loop: &mut EventLoop<IoManager<Message>>
)
fn register_stream(
&self,
_stream: usize,
_reg: Token,
_event_loop: &mut EventLoop<IoManager<Message>>
)
Register a new stream with the event loop
sourcefn update_stream(
&self,
_stream: usize,
_reg: Token,
_event_loop: &mut EventLoop<IoManager<Message>>
)
fn update_stream(
&self,
_stream: usize,
_reg: Token,
_event_loop: &mut EventLoop<IoManager<Message>>
)
Re-register a stream with the event loop
sourcefn deregister_stream(
&self,
_stream: usize,
_event_loop: &mut EventLoop<IoManager<Message>>
)
fn deregister_stream(
&self,
_stream: usize,
_event_loop: &mut EventLoop<IoManager<Message>>
)
Deregister a stream. Called whenstream is removed from event loop
Auto Trait Implementations
impl<T> !RefUnwindSafe for Informant<T>
impl<T> Send for Informant<T> where
T: Send,
impl<T> Sync for Informant<T> where
T: Sync,
impl<T> Unpin for Informant<T> where
T: Unpin,
impl<T> !UnwindSafe for Informant<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more