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

source

pub fn builder() -> ConnectParamsBuilder

Returns a new builder for ConnectParams.

source

pub fn from_file<P>(path: P) -> Result<ConnectParams, HdbError>
where P: AsRef<Path>,

Reads a url from the given file and converts it into ConnectParams.

§Errors

HdbError::ConnParams

source

pub fn server_certs(&self) -> Option<&Vec<ServerCerts>>

The ServerCerts.

source

pub fn host(&self) -> &str

The host.

source

pub fn addr(&self) -> &str

The socket address.

source

pub fn is_tls(&self) -> bool

Whether TLS or a plain TCP connection is to be used.

source

pub fn dbuser(&self) -> &str

The database user.

source

pub fn password(&self) -> &SecUtf8

The password.

source

pub fn clientlocale(&self) -> Option<&str>

The client locale.

source

pub fn dbname(&self) -> Option<&str>

The name of the (MDC) database.

source

pub fn network_group(&self) -> Option<&str>

The name of a network group.

source

pub fn precheck_certificates(&self) -> Result<Vec<String>, HdbError>

Provide detailed insight into acceptance of configured certificates

Trait Implementations§

source§

impl Clone for ConnectParams

source§

fn clone(&self) -> ConnectParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConnectParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ConnectParams

source§

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl IntoConnectParams for &ConnectParams

source§

fn into_connect_params(self) -> Result<ConnectParams, HdbError>

Converts the value of self into a ConnectParams. Read more
source§

impl IntoConnectParams for ConnectParams

source§

fn into_connect_params(self) -> Result<ConnectParams, HdbError>

Converts the value of self into a ConnectParams. Read more
source§

impl PartialEq for ConnectParams

source§

fn eq(&self, other: &ConnectParams) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for ConnectParams

source§

impl StructuralPartialEq for ConnectParams

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T