[−][src]Struct hdbconnect::ConnectParamsBuilder
A builder for ConnectParams
.
Instantiating a ConnectParamsBuilder
programmatically
use hdbconnect::ConnectParams; let connect_params = ConnectParams::builder() .hostname("abcd123") .port(2222) .dbuser("MEIER") .password("schlau") .build() .unwrap();
Instantiating a ConnectParamsBuilder
from a URL
See module url
for details about the supported URLs.
use hdbconnect::IntoConnectParamsBuilder; let conn_params = "hdbsql://abcd123:2222" .into_connect_params_builder() .unwrap() .dbuser("MEIER") .password("schlau") .build() .unwrap();
Implementations
impl ConnectParamsBuilder
[src]
pub fn new() -> Self
[src]
Creates a new builder.
pub fn hostname<H: AsRef<str>>(&mut self, hostname: H) -> &mut Self
[src]
Sets the hostname.
pub fn port(&mut self, port: u16) -> &mut Self
[src]
Sets the port.
pub fn dbuser<D: AsRef<str>>(&mut self, dbuser: D) -> &mut Self
[src]
Sets the database user.
pub fn password<P: AsRef<str>>(&mut self, pw: P) -> &mut Self
[src]
Sets the password.
pub fn unset_password(&mut self) -> &mut Self
[src]
Unsets the password.
pub fn dbname<D: AsRef<str>>(&mut self, dbname: D) -> &mut Self
[src]
Sets the database name.
This allows specifying host and port of the system DB and getting automatically redirected and connected to the specified tenant database.
pub fn network_group<D: AsRef<str>>(&mut self, network_group: D) -> &mut Self
[src]
Sets the network group.
pub fn clientlocale<P: AsRef<str>>(&mut self, cl: P) -> &mut Self
[src]
Sets the client locale.
pub fn clientlocale_from_env_lang(&mut self) -> &mut Self
[src]
Sets the client locale from the value of the environment variable LANG
pub fn tls_with(&mut self, server_certs: ServerCerts) -> &mut Self
[src]
Makes the driver use TLS for the connection to the database.
Requires that the server's certificate is provided with one of the
enum variants of ServerCerts
.
If needed, you can call this function multiple times with different ServerCert
variants.
Example:
let mut conn_params = ConnectParams::builder() // ...more settings required... .tls_with(ServerCerts::Direct(string_with_certificate)) .build();
pub fn build(&self) -> HdbResult<ConnectParams>
[src]
Constructs a ConnectParams
from the builder.
Errors
HdbError::Usage
if the builder was not yet configured to
create a meaningful ConnectParams
pub fn to_url(&self) -> HdbResult<String>
[src]
Returns the url for this connection, without the password.
Errors
HdbError::Usage
if the builder was not yet configured to build a correct url
pub fn get_hostname(&self) -> Option<&str>
[src]
Getter
pub fn get_dbuser(&self) -> Option<&str>
[src]
Getter
pub fn get_password(&self) -> Option<&SecUtf8>
[src]
Getter
pub fn get_port(&self) -> Option<u16>
[src]
Getter
pub fn get_clientlocale(&self) -> Option<&str>
[src]
Getter
pub fn get_server_certs(&self) -> &Vec<ServerCerts>
[src]
Getter
Trait Implementations
impl Clone for ConnectParamsBuilder
[src]
pub fn clone(&self) -> ConnectParamsBuilder
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConnectParamsBuilder
[src]
impl Default for ConnectParamsBuilder
[src]
pub fn default() -> ConnectParamsBuilder
[src]
impl<'de> Deserialize<'de> for ConnectParamsBuilder
[src]
pub fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for ConnectParamsBuilder
[src]
impl Into<String> for ConnectParamsBuilder
[src]
impl IntoConnectParams for ConnectParamsBuilder
[src]
pub fn into_connect_params(self) -> HdbResult<ConnectParams>
[src]
impl IntoConnectParams for &ConnectParamsBuilder
[src]
pub fn into_connect_params(self) -> HdbResult<ConnectParams>
[src]
impl IntoConnectParamsBuilder for ConnectParamsBuilder
[src]
pub fn into_connect_params_builder(self) -> HdbResult<ConnectParamsBuilder>
[src]
impl PartialEq<ConnectParamsBuilder> for ConnectParamsBuilder
[src]
pub fn eq(&self, other: &ConnectParamsBuilder) -> bool
[src]
pub fn ne(&self, other: &ConnectParamsBuilder) -> bool
[src]
impl Serialize for ConnectParamsBuilder
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for ConnectParamsBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConnectParamsBuilder
[src]
impl Send for ConnectParamsBuilder
[src]
impl Sync for ConnectParamsBuilder
[src]
impl Unpin for ConnectParamsBuilder
[src]
impl UnwindSafe for ConnectParamsBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,