Struct hdbconnect::ConnectParams
source · pub struct ConnectParams { /* private fields */ }
Expand description
An immutable struct with all information necessary to open a new connection to a HANA database.
§Instantiating a ConnectParams
using the ConnectParamsBuilder
See ConnectParamsBuilder
for details.
use hdbconnect::{ConnectParams, ServerCerts};
let certificate: String = read_certificate();
let connect_params = ConnectParams::builder()
.hostname("the_host")
.port(2222)
.dbuser("my_user")
.password("my_passwd")
.tls_with(ServerCerts::Direct(certificate))
.build()
.unwrap();
§Instantiating a ConnectParams
from a URL
See module url
for details about the supported URLs.
use hdbconnect::IntoConnectParams;
let conn_params = "hdbsql://my_user:my_passwd@the_host:2222"
.into_connect_params()
.unwrap();
§Redirects
hdbconnect
supports redirects.
You can connect to an MDC tenant database by specifying the host and port of the
system database, and the name of the database to which you want to be connected
with url parameter “db” or with ConnectParamsBuilder::dbname
.
Implementations§
source§impl ConnectParams
impl ConnectParams
sourcepub fn builder() -> ConnectParamsBuilder
pub fn builder() -> ConnectParamsBuilder
Returns a new builder for ConnectParams
.
sourcepub fn from_file<P>(path: P) -> Result<ConnectParams, HdbError>
pub fn from_file<P>(path: P) -> Result<ConnectParams, HdbError>
sourcepub fn server_certs(&self) -> Option<&Vec<ServerCerts>>
pub fn server_certs(&self) -> Option<&Vec<ServerCerts>>
The ServerCerts
.
sourcepub fn clientlocale(&self) -> Option<&str>
pub fn clientlocale(&self) -> Option<&str>
The client locale.
sourcepub fn network_group(&self) -> Option<&str>
pub fn network_group(&self) -> Option<&str>
The name of a network group.
Trait Implementations§
source§impl Clone for ConnectParams
impl Clone for ConnectParams
source§fn clone(&self) -> ConnectParams
fn clone(&self) -> ConnectParams
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ConnectParams
impl Debug for ConnectParams
source§impl<'de> Deserialize<'de> for ConnectParams
impl<'de> Deserialize<'de> for ConnectParams
source§fn deserialize<D>(
deserializer: D,
) -> Result<ConnectParams, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ConnectParams, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ConnectParams
impl Display for ConnectParams
source§impl IntoConnectParams for &ConnectParams
impl IntoConnectParams for &ConnectParams
source§fn into_connect_params(self) -> Result<ConnectParams, HdbError>
fn into_connect_params(self) -> Result<ConnectParams, HdbError>
source§impl IntoConnectParams for ConnectParams
impl IntoConnectParams for ConnectParams
source§fn into_connect_params(self) -> Result<ConnectParams, HdbError>
fn into_connect_params(self) -> Result<ConnectParams, HdbError>
source§impl PartialEq for ConnectParams
impl PartialEq for ConnectParams
source§fn eq(&self, other: &ConnectParams) -> bool
fn eq(&self, other: &ConnectParams) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ConnectParams
impl StructuralPartialEq for ConnectParams
Auto Trait Implementations§
impl Freeze for ConnectParams
impl RefUnwindSafe for ConnectParams
impl Send for ConnectParams
impl Sync for ConnectParams
impl Unpin for ConnectParams
impl UnwindSafe for ConnectParams
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