pub struct AddAddress {
pub sequence: VarInt,
pub address: SocketAddr,
/* private fields */
}
Expand description
Unified ADD_ADDRESS frame that can handle both formats
Fields§
§sequence: VarInt
Sequence number for this address advertisement
address: SocketAddr
Socket address being advertised
Implementations§
Source§impl AddAddress
impl AddAddress
Sourcepub fn new(sequence: VarInt, address: SocketAddr) -> Self
pub fn new(sequence: VarInt, address: SocketAddr) -> Self
Create a new AddAddress 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 (for compatibility)
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_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
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
Trait Implementations§
Source§impl Clone for AddAddress
impl Clone for AddAddress
Source§fn clone(&self) -> AddAddress
fn clone(&self) -> AddAddress
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 AddAddress
impl Debug for AddAddress
Source§impl PartialEq for AddAddress
impl PartialEq for AddAddress
impl Eq for AddAddress
impl StructuralPartialEq for AddAddress
Auto Trait Implementations§
impl Freeze for AddAddress
impl RefUnwindSafe for AddAddress
impl Send for AddAddress
impl Sync for AddAddress
impl Unpin for AddAddress
impl UnwindSafe for AddAddress
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.