pub mod core;
pub mod decisions;
pub mod dispatch;
use std::time::Instant;
use crate::engine::bt_message_dispatcher::{ActiveInteractionChecker, FloodingStat};
use crate::engine::bt_message_handler::BtPeerMessageHandler;
use crate::engine::bt_message_validation::BtMessageValidator;
use crate::engine::bt_request_factory::BtRequestFactory;
use crate::engine::extension_registry::ExtensionRegistry;
use super::types::*;
pub struct BtPeerInteractive {
pub(crate) state: PeerConnectionState,
pub(crate) handler: BtPeerMessageHandler,
pub(crate) am_choking: bool,
pub(crate) am_interested: bool,
pub(crate) peer_choking: bool,
pub(crate) peer_interested: bool,
pub(crate) keep_alive_timer: Instant,
pub(crate) flooding_timer: Instant,
pub(crate) inactive_timer: Instant,
pub(crate) per_sec_timer: Instant,
pub(crate) pex_timer: Instant,
pub(crate) keep_alive_interval_secs: u64,
pub(crate) max_outstanding_request: usize,
pub(crate) allowed_fast_set_size: usize,
pub(crate) flooding_stat: FloodingStat,
pub(crate) active_interaction_checker: ActiveInteractionChecker,
pub(crate) last_have_index: u64,
pub(crate) num_received_message: usize,
#[allow(dead_code)]
pub(crate) num_pieces: u32,
pub(crate) info_hash: [u8; 20],
pub(crate) ut_pex_enabled: bool,
pub(crate) dht_enabled: bool,
pub(crate) dht_port_handler: Option<std::sync::Arc<dyn Fn(u16) + Send + Sync>>,
pub(crate) metadata_get_mode: bool,
pub(crate) message_validator: Option<BtMessageValidator>,
pub(crate) download_finished: bool,
pub(crate) extension_registry: ExtensionRegistry,
#[allow(clippy::type_complexity)]
pub(crate) extension_update_handler: Option<
std::sync::Arc<dyn Fn(&crate::engine::extension_registry::ExtensionUpdate) + Send + Sync>,
>,
pub(crate) request_factory: BtRequestFactory,
pub(crate) endgame: bool,
}