aquatic_ws_protocol: refactor, moving code into submodules

This commit is contained in:
Joakim Frostegård 2021-10-16 01:46:32 +02:00
parent 7c833958d8
commit 71c43aca47
11 changed files with 345 additions and 304 deletions

View file

@ -0,0 +1,19 @@
use serde::{Deserialize, Serialize};
use crate::common::*;
/// Apparently, these are sent to a number of peers when they are set
/// in an AnnounceRequest
/// action = "announce"
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct MiddlemanOfferToPeer {
pub action: AnnounceAction,
/// Peer id of peer sending offer
/// Note: if equal to client peer_id, client ignores offer
pub peer_id: PeerId,
pub info_hash: InfoHash,
/// Gets copied from AnnounceRequestOffer
pub offer: JsonValue,
/// Gets copied from AnnounceRequestOffer
pub offer_id: OfferId,
}