Struct bip_peer::messages::ExtendedMessage
[−]
[src]
pub struct ExtendedMessage { /* fields omitted */ }
Message for notifying peers of extensions we support.
See http://www.bittorrent.org/beps/bep_0010.html
.
Methods
impl ExtendedMessage
[src]
fn from_builder(builder: ExtendedMessageBuilder) -> ExtendedMessage
[src]
Create an ExtendedMessage
from an ExtendedMessageBuilder
.
fn parse_bytes(
_input: (),
bytes: Bytes,
len: u32
) -> IResult<(), Result<ExtendedMessage>>
[src]
_input: (),
bytes: Bytes,
len: u32
) -> IResult<(), Result<ExtendedMessage>>
Parse an ExtendedMessage
from some raw bencode of the given length.
fn write_bytes<W>(&self, writer: W) -> Result<()> where
W: Write,
[src]
W: Write,
Write the ExtendedMessage
out to the given writer.
fn bencode_size(&self) -> usize
[src]
Get the size of the bencode portion of this message.
fn query_id(&self, ext_type: &ExtendedType) -> Option<u8>
[src]
Query for the id corresponding to the given ExtendedType
.
fn our_id(&self) -> Option<&str>
[src]
Retrieve our id from the message.
fn our_tcp_port(&self) -> Option<u16>
[src]
Retrieve our tcp port from the message.
fn their_ip(&self) -> Option<IpAddr>
[src]
Retrieve their ip address from the message.
fn our_ipv6_addr(&self) -> Option<Ipv6Addr>
[src]
Retrieve our ipv6 address from the message.
fn our_ipv4_addr(&self) -> Option<Ipv4Addr>
[src]
Retrieve our ipv4 address from the message.
fn our_max_requests(&self) -> Option<i64>
[src]
Retrieve our max queued requests from the message.
fn metadata_size(&self) -> Option<i64>
[src]
Retrieve the info dictionary metadata size from the message.
fn bencode_ref<'a>(&'a self) -> BencodeRef<'a>
[src]
Retrieve a raw BencodeRef
representing the current message.
Trait Implementations
impl Clone for ExtendedMessage
[src]
fn clone(&self) -> ExtendedMessage
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ExtendedMessage
[src]
impl PartialEq for ExtendedMessage
[src]
fn eq(&self, __arg_0: &ExtendedMessage) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ExtendedMessage) -> bool
[src]
This method tests for !=
.