pub struct TOR_PROXY { /* private fields */ }
Expand description
The default TOR socks5 proxy address, 127.0.0.1:9050
.
The proxy can be configured in the SOCKS section of /etc/tor/torrc
.
See the TOR manual for more information on torrc
.
Methods from Deref<Target = SocketAddr>§
1.7.0 · Sourcepub fn ip(&self) -> IpAddr
pub fn ip(&self) -> IpAddr
Returns the IP address associated with this socket address.
§Examples
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.ip(), IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)));
1.0.0 · Sourcepub fn port(&self) -> u16
pub fn port(&self) -> u16
Returns the port number associated with this socket address.
§Examples
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.port(), 8080);
1.16.0 · Sourcepub fn is_ipv4(&self) -> bool
pub fn is_ipv4(&self) -> bool
Returns true
if the IP address in this SocketAddr
is an
IPv4
address, and false
otherwise.
§Examples
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.is_ipv4(), true);
assert_eq!(socket.is_ipv6(), false);
1.16.0 · Sourcepub fn is_ipv6(&self) -> bool
pub fn is_ipv6(&self) -> bool
Returns true
if the IP address in this SocketAddr
is an
IPv6
address, and false
otherwise.
§Examples
use std::net::{IpAddr, Ipv6Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 0, 1)), 8080);
assert_eq!(socket.is_ipv4(), false);
assert_eq!(socket.is_ipv6(), true);
Trait Implementations§
Source§impl Deref for TOR_PROXY
impl Deref for TOR_PROXY
Source§type Target = SocketAddr
type Target = SocketAddr
The resulting type after dereferencing.
Source§fn deref(&self) -> &SocketAddr
fn deref(&self) -> &SocketAddr
Dereferences the value.
impl LazyStatic for TOR_PROXY
Auto Trait Implementations§
impl Freeze for TOR_PROXY
impl RefUnwindSafe for TOR_PROXY
impl Send for TOR_PROXY
impl Sync for TOR_PROXY
impl Unpin for TOR_PROXY
impl UnwindSafe for TOR_PROXY
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