pub struct Network {
pub peer_lock: Arc<RwLock<PeerCollection>>,
pub io_interface: Box<dyn InterfaceIO + Send + Sync>,
pub wallet_lock: Arc<RwLock<Wallet>>,
pub config_lock: Arc<RwLock<dyn Configuration + Send + Sync>>,
pub timer: Timer,
}
Fields§
§peer_lock: Arc<RwLock<PeerCollection>>
§io_interface: Box<dyn InterfaceIO + Send + Sync>
§wallet_lock: Arc<RwLock<Wallet>>
§config_lock: Arc<RwLock<dyn Configuration + Send + Sync>>
§timer: Timer
Implementations§
Source§impl Network
impl Network
pub fn new( io_handler: Box<dyn InterfaceIO + Send + Sync>, peer_lock: Arc<RwLock<PeerCollection>>, wallet_lock: Arc<RwLock<Wallet>>, config_lock: Arc<RwLock<dyn Configuration + Send + Sync>>, timer: Timer, ) -> Network
pub async fn propagate_block(&self, block: &Block)
pub async fn propagate_transaction(&self, transaction: &Transaction)
pub async fn handle_peer_disconnect( &mut self, peer_index: u64, disconnect_type: PeerDisconnectType, )
pub async fn handle_new_peer( &mut self, peer_index: u64, ip_addr: Option<String>, )
pub async fn handle_handshake_challenge( &self, peer_index: u64, challenge: HandshakeChallenge, wallet_lock: Arc<RwLock<Wallet>>, config_lock: Arc<RwLock<dyn Configuration + Send + Sync>>, )
pub async fn handle_handshake_response( &mut self, peer_index: u64, response: HandshakeResponse, wallet_lock: Arc<RwLock<Wallet>>, blockchain_lock: Arc<RwLock<Blockchain>>, configs_lock: Arc<RwLock<dyn Configuration + Send + Sync>>, )
pub async fn handle_received_key_list( &mut self, peer_index: PeerIndex, key_list: Vec<SaitoPublicKey>, ) -> Result<(), Error>
pub async fn send_key_list(&self, key_list: &[SaitoPublicKey])
pub async fn process_incoming_block_hash( &mut self, block_hash: SaitoHash, block_id: BlockId, peer_index: PeerIndex, blockchain_lock: Arc<RwLock<Blockchain>>, mempool_lock: Arc<RwLock<Mempool>>, ) -> Option<()>
pub async fn initialize_static_peers( &mut self, configs_lock: Arc<RwLock<dyn Configuration + Send + Sync>>, )
pub async fn handle_new_stun_peer( &mut self, peer_index: PeerIndex, public_key: SaitoPublicKey, )
pub async fn remove_stun_peer(&mut self, peer_index: PeerIndex)
pub async fn connect_to_static_peers(&mut self, current_time: Timestamp)
pub async fn send_pings(&mut self)
pub async fn update_peer_timer(&mut self, peer_index: PeerIndex)
Auto Trait Implementations§
impl Freeze for Network
impl !RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl !UnwindSafe for Network
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