Struct taos_query::Address
source · pub struct Address {
pub host: Option<String>,
pub port: Option<u16>,
pub path: Option<String>,
}
Expand description
A simple struct to represent a server address, with host:port or socket path.
Fields§
§host: Option<String>
Host or ip address of the server.
port: Option<u16>
Port to connect to the server.
path: Option<String>
Use unix socket path to connect.
Implementations§
source§impl Address
impl Address
sourcepub fn new(host: impl Into<String>, port: u16) -> Address
pub fn new(host: impl Into<String>, port: u16) -> Address
Construct server address with host and port.
sourcepub fn from_host(host: impl Into<String>) -> Address
pub fn from_host(host: impl Into<String>) -> Address
Construct server address with host or ip address only.
sourcepub fn from_path(path: impl Into<String>) -> Address
pub fn from_path(path: impl Into<String>) -> Address
Construct server address with unix socket path.
pub fn is_empty(&self) -> bool
Trait Implementations§
source§impl PartialEq for Address
impl PartialEq for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more