#[derive(Debug, Clone, Default)]
pub struct ConnectOptions {
pub(super) host: Option<String>,
pub(super) user: Option<String>,
pub(super) password: Option<String>,
pub(super) database: Option<String>,
pub(super) port: u32,
pub(super) unix_socket: Option<String>,
}
impl ConnectOptions {
#[inline]
pub fn new() -> Self {
Self::default()
}
#[inline]
pub fn host(mut self, value: impl Into<String>) -> Self {
self.host = Some(value.into());
self
}
#[inline]
pub fn user(mut self, value: impl Into<String>) -> Self {
self.user = Some(value.into());
self
}
#[inline]
pub fn password(mut self, value: impl Into<String>) -> Self {
self.password = Some(value.into());
self
}
#[inline]
pub fn database(mut self, value: impl Into<String>) -> Self {
self.database = Some(value.into());
self
}
#[inline]
pub fn port(mut self, value: u32) -> Self {
self.port = value;
self
}
#[inline]
pub fn unix_socket(mut self, value: impl Into<String>) -> Self {
self.unix_socket = Some(value.into());
self
}
}