pub struct RemoteAddr(pub SocketAddr, pub AddrProto);Expand description
A representation of a remote IP address.
Tuple Fields§
§0: SocketAddr§1: AddrProtoImplementations§
Source§impl RemoteAddr
impl RemoteAddr
Sourcepub fn prefix(&self, chop: Option<usize>) -> String
pub fn prefix(&self, chop: Option<usize>) -> String
Get the address’ prefix (returns the entire address for IPV4 addresses).
Operates on the IP address without colon characters.
Sourcepub fn to_prefix(self, chop: Option<usize>) -> Self
pub fn to_prefix(self, chop: Option<usize>) -> Self
Self::prefix, but it returns another RemoteAddr.
Sourcepub fn ipv6_inner(&self) -> String
pub fn ipv6_inner(&self) -> String
Get the innter content from the address (as ipv6).
Trait Implementations§
Source§impl Clone for RemoteAddr
impl Clone for RemoteAddr
Source§fn clone(&self) -> RemoteAddr
fn clone(&self) -> RemoteAddr
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 RemoteAddr
impl Debug for RemoteAddr
Auto Trait Implementations§
impl Freeze for RemoteAddr
impl RefUnwindSafe for RemoteAddr
impl Send for RemoteAddr
impl Sync for RemoteAddr
impl Unpin for RemoteAddr
impl UnwindSafe for RemoteAddr
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