mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws_protocol: add documentation (as comments)
This commit is contained in:
parent
c02d7f2113
commit
6624df1e44
3 changed files with 19 additions and 5 deletions
|
|
@ -1,3 +1,15 @@
|
|||
//! WebTorrent protocol implementation
|
||||
//!
|
||||
//! Typical announce workflow:
|
||||
//! - Peer A sends announce request with info hash and offers
|
||||
//! - Tracker sends on offers to other peers announcing with that info hash and
|
||||
//! sends back announce response to peer A
|
||||
//! - Tracker receives answers to those offers from other peers and send them
|
||||
//! on to peer A
|
||||
//!
|
||||
//! Typical scrape workflow
|
||||
//! - Peer sends scrape request and receives scrape response
|
||||
|
||||
pub mod common;
|
||||
pub mod request;
|
||||
pub mod response;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ pub mod scrape;
|
|||
pub use announce::*;
|
||||
pub use scrape::*;
|
||||
|
||||
/// Message received by tracker
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum InMessage {
|
||||
|
|
|
|||
|
|
@ -12,14 +12,15 @@ pub use error::*;
|
|||
pub use offer::*;
|
||||
pub use scrape::*;
|
||||
|
||||
/// Message sent by tracker
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum OutMessage {
|
||||
Offer(offer::MiddlemanOfferToPeer),
|
||||
Answer(answer::MiddlemanAnswerToPeer),
|
||||
AnnounceResponse(announce::AnnounceResponse),
|
||||
ScrapeResponse(scrape::ScrapeResponse),
|
||||
ErrorResponse(error::ErrorResponse),
|
||||
Offer(MiddlemanOfferToPeer),
|
||||
Answer(MiddlemanAnswerToPeer),
|
||||
AnnounceResponse(AnnounceResponse),
|
||||
ScrapeResponse(ScrapeResponse),
|
||||
ErrorResponse(ErrorResponse),
|
||||
}
|
||||
|
||||
impl OutMessage {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue