pub struct PunchMeNow {
pub round: VarInt,
pub paired_with_sequence_number: VarInt,
pub address: SocketAddr,
/* private fields */
}
Expand description
Unified PUNCH_ME_NOW frame
Fields§
§round: VarInt
Round number for coordination
paired_with_sequence_number: VarInt
Sequence number of the address to punch to
address: SocketAddr
Address to punch to
Implementations§
Source§impl PunchMeNow
impl PunchMeNow
Sourcepub fn new(
round: VarInt,
paired_with_sequence_number: VarInt,
address: SocketAddr,
) -> Self
pub fn new( round: VarInt, paired_with_sequence_number: VarInt, address: SocketAddr, ) -> Self
Create a new PunchMeNow frame
Sourcepub fn encode<W: BufMut>(&self, buf: &mut W)
pub fn encode<W: BufMut>(&self, buf: &mut W)
Encode method for compatibility with existing code Uses the legacy format by default for backward compatibility
Sourcepub fn encode_rfc<W: BufMut>(&self, buf: &mut W)
pub fn encode_rfc<W: BufMut>(&self, buf: &mut W)
Encode in RFC-compliant format
Sourcepub fn encode_legacy<W: BufMut>(&self, buf: &mut W)
pub fn encode_legacy<W: BufMut>(&self, buf: &mut W)
Encode in legacy format
Sourcepub fn decode_rfc<R: Buf>(
r: &mut R,
is_ipv6: bool,
) -> Result<Self, UnexpectedEnd>
pub fn decode_rfc<R: Buf>( r: &mut R, is_ipv6: bool, ) -> Result<Self, UnexpectedEnd>
Decode from RFC format
Sourcepub fn decode_auto<R: Buf>(
r: &mut R,
is_ipv6: bool,
) -> Result<Self, UnexpectedEnd>
pub fn decode_auto<R: Buf>( r: &mut R, is_ipv6: bool, ) -> Result<Self, UnexpectedEnd>
Try to decode, detecting format automatically
Sourcepub fn decode_legacy<R: Buf>(r: &mut R) -> Result<Self, UnexpectedEnd>
pub fn decode_legacy<R: Buf>(r: &mut R) -> Result<Self, UnexpectedEnd>
Decode from legacy format
Trait Implementations§
Source§impl Clone for PunchMeNow
impl Clone for PunchMeNow
Source§fn clone(&self) -> PunchMeNow
fn clone(&self) -> PunchMeNow
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PunchMeNow
impl Debug for PunchMeNow
Source§impl PartialEq for PunchMeNow
impl PartialEq for PunchMeNow
impl Eq for PunchMeNow
impl StructuralPartialEq for PunchMeNow
Auto Trait Implementations§
impl Freeze for PunchMeNow
impl RefUnwindSafe for PunchMeNow
impl Send for PunchMeNow
impl Sync for PunchMeNow
impl Unpin for PunchMeNow
impl UnwindSafe for PunchMeNow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.