mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +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 common;
|
||||||
pub mod request;
|
pub mod request;
|
||||||
pub mod response;
|
pub mod response;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ pub mod scrape;
|
||||||
pub use announce::*;
|
pub use announce::*;
|
||||||
pub use scrape::*;
|
pub use scrape::*;
|
||||||
|
|
||||||
|
/// Message received by tracker
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum InMessage {
|
pub enum InMessage {
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,15 @@ pub use error::*;
|
||||||
pub use offer::*;
|
pub use offer::*;
|
||||||
pub use scrape::*;
|
pub use scrape::*;
|
||||||
|
|
||||||
|
/// Message sent by tracker
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum OutMessage {
|
pub enum OutMessage {
|
||||||
Offer(offer::MiddlemanOfferToPeer),
|
Offer(MiddlemanOfferToPeer),
|
||||||
Answer(answer::MiddlemanAnswerToPeer),
|
Answer(MiddlemanAnswerToPeer),
|
||||||
AnnounceResponse(announce::AnnounceResponse),
|
AnnounceResponse(AnnounceResponse),
|
||||||
ScrapeResponse(scrape::ScrapeResponse),
|
ScrapeResponse(ScrapeResponse),
|
||||||
ErrorResponse(error::ErrorResponse),
|
ErrorResponse(ErrorResponse),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OutMessage {
|
impl OutMessage {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue