Struct tor_stream::TOR_PROXY[][src]

pub struct TOR_PROXY { /* fields omitted */ }
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>

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)));

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);

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);

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

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.