[][src]Struct aquatic_ws_protocol::AnnounceRequest

pub struct AnnounceRequest {
    pub action: AnnounceAction,
    pub info_hash: InfoHash,
    pub peer_id: PeerId,
    pub bytes_left: Option<usize>,
    pub event: Option<AnnounceEvent>,
    pub offers: Option<Vec<AnnounceRequestOffer>>,
    pub numwant: Option<usize>,
    pub answer: Option<JsonValue>,
    pub to_peer_id: Option<PeerId>,
    pub offer_id: Option<OfferId>,
}

Fields

action: AnnounceActioninfo_hash: InfoHashpeer_id: PeerIdbytes_left: Option<usize>

Just called "left" in protocol. Is set to None in some cases, such as when opening a magnet link

event: Option<AnnounceEvent>

Can be empty. Then, default is "update"

offers: Option<Vec<AnnounceRequestOffer>>

Only when this is an array offers are sent to random peers Length of this is number of peers wanted? Max length of this is 10 in reference client code Not sent when announce event is stopped or completed

numwant: Option<usize>

Seems to only get sent by client when sending offers, and is also same as length of offers vector (or at least never less) Max length of this is 10 in reference client code Could probably be ignored, offers.len() should provide needed info

answer: Option<JsonValue>

If empty, send response before sending offers (or possibly "skip sending update back"?) Else, send MiddlemanAnswerToPeer to peer with "to_peer_id" as peer_id. I think using Option is good, it seems like this isn't always set (same as offers)

to_peer_id: Option<PeerId>

Likely undefined if !(answer == true)

offer_id: Option<OfferId>

Sent if answer is set

Trait Implementations

impl Clone for AnnounceRequest[src]

impl Debug for AnnounceRequest[src]

impl<'de> Deserialize<'de> for AnnounceRequest[src]

impl Eq for AnnounceRequest[src]

impl PartialEq<AnnounceRequest> for AnnounceRequest[src]

impl Serialize for AnnounceRequest[src]

impl StructuralEq for AnnounceRequest[src]

impl StructuralPartialEq for AnnounceRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,