Struct bip_utracker::announce::AnnounceRequest
[−]
[src]
pub struct AnnounceRequest<'a> { /* fields omitted */ }
Announce request sent from the client to the server.
IPv6 is supported but is not standard.
Methods
impl<'a> AnnounceRequest<'a>
[src]
fn new(
hash: InfoHash,
peer_id: PeerId,
state: ClientState,
ip: SourceIP,
key: u32,
num_want: DesiredPeers,
port: u16,
options: AnnounceOptions<'a>
) -> AnnounceRequest<'a>
hash: InfoHash,
peer_id: PeerId,
state: ClientState,
ip: SourceIP,
key: u32,
num_want: DesiredPeers,
port: u16,
options: AnnounceOptions<'a>
) -> AnnounceRequest<'a>
Create a new AnnounceRequest.
fn from_bytes_v4(bytes: &'a [u8]) -> IResult<&'a [u8], AnnounceRequest<'a>>
Construct an IPv4 AnnounceRequest from the given bytes.
fn from_bytes_v6(bytes: &'a [u8]) -> IResult<&'a [u8], AnnounceRequest<'a>>
Construct an IPv6 AnnounceRequest from the given bytes.
fn write_bytes<W>(&self, writer: W) -> Result<()> where
W: Write,
W: Write,
Write the AnnounceRequest to the given writer.
fn info_hash(&self) -> InfoHash
InfoHash of the current request.
fn peer_id(&self) -> PeerId
PeerId of the current request.
fn state(&self) -> ClientState
State reported by the client in the given request.
fn source_ip(&self) -> SourceIP
Source address to send the response to.
fn key(&self) -> u32
Unique key randomized by the client that the server can use.
fn num_want(&self) -> DesiredPeers
Number of peers desired by the client.
fn port(&self) -> u16
Port to send the response to.
fn options(&self) -> &AnnounceOptions<'a>
Set of AnnounceOptions supplied in the request.
fn to_owned(&self) -> AnnounceRequest<'static>
Create an owned version of AnnounceRequest.
Trait Implementations
impl<'a> Clone for AnnounceRequest<'a>
[src]
fn clone(&self) -> AnnounceRequest<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a> Debug for AnnounceRequest<'a>
[src]
impl<'a> PartialEq for AnnounceRequest<'a>
[src]
fn eq(&self, __arg_0: &AnnounceRequest<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AnnounceRequest<'a>) -> bool
This method tests for !=
.