Enum redis::ConnectionAddr
source · [−]pub enum ConnectionAddr {
Tcp(String, u16),
TcpTls {
host: String,
port: u16,
insecure: bool,
},
Unix(PathBuf),
}
Expand description
Defines the connection address.
Not all connection addresses are supported on all platforms. For instance to connect to a unix socket you need to run this on an operating system that supports them.
Variants
Tcp(String, u16)
Format for this is (host, port)
.
TcpTls
Fields
host: String
Hostname
port: u16
Port
insecure: bool
Disable hostname verification when connecting.
Warning
You should think very carefully before you use this method. If hostname verification is not used, any valid certificate for any site will be trusted for use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.
Format for this is (host, port)
.
Unix(PathBuf)
Format for this is the path to the unix socket.
Implementations
sourceimpl ConnectionAddr
impl ConnectionAddr
sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Checks if this address is supported.
Because not all platforms support all connection addresses this is a quick way to figure out if a connection method is supported. Currently this only affects unix connections which are only supported on unix platforms and on older versions of rust also require an explicit feature to be enabled.
Trait Implementations
sourceimpl Clone for ConnectionAddr
impl Clone for ConnectionAddr
sourcefn clone(&self) -> ConnectionAddr
fn clone(&self) -> ConnectionAddr
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConnectionAddr
impl Debug for ConnectionAddr
sourceimpl Display for ConnectionAddr
impl Display for ConnectionAddr
sourceimpl PartialEq<ConnectionAddr> for ConnectionAddr
impl PartialEq<ConnectionAddr> for ConnectionAddr
sourcefn eq(&self, other: &ConnectionAddr) -> bool
fn eq(&self, other: &ConnectionAddr) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ConnectionAddr) -> bool
fn ne(&self, other: &ConnectionAddr) -> bool
This method tests for !=
.
impl StructuralPartialEq for ConnectionAddr
Auto Trait Implementations
impl RefUnwindSafe for ConnectionAddr
impl Send for ConnectionAddr
impl Sync for ConnectionAddr
impl Unpin for ConnectionAddr
impl UnwindSafe for ConnectionAddr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more