nothing
This commit is contained in:
parent
2fc225cfa2
commit
e843209aa9
3 changed files with 22 additions and 18 deletions
|
|
@ -2,7 +2,25 @@ use std::{collections::HashSet, net::SocketAddr, sync::Arc};
|
|||
|
||||
use tokio::sync::{Notify, Semaphore};
|
||||
|
||||
use crate::{torrent_state::InflightRequest, type_aliases::BF};
|
||||
use crate::{
|
||||
lengths::{ChunkInfo, ValidPieceIndex},
|
||||
type_aliases::BF,
|
||||
};
|
||||
|
||||
#[derive(Debug, Hash, PartialEq, Eq)]
|
||||
pub struct InflightRequest {
|
||||
pub piece: ValidPieceIndex,
|
||||
pub chunk: u32,
|
||||
}
|
||||
|
||||
impl From<&ChunkInfo> for InflightRequest {
|
||||
fn from(c: &ChunkInfo) -> Self {
|
||||
Self {
|
||||
piece: c.piece_index,
|
||||
chunk: c.chunk_index,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum PeerState {
|
||||
Connecting(SocketAddr),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue