Skip to main content

ConnectConfig

Struct ConnectConfig 

Source
pub struct ConnectConfig {
Show 14 fields pub host: String, pub port: u16, pub database: String, pub user: String, pub password: String, pub role: Option<String>, pub charset: String, pub dialect: i32, pub wire_crypt: WireCrypt, pub connect_timeout: Option<Duration>, pub page_size: Option<i32>, pub timezone: Option<String>, pub parallel_workers: Option<i32>, pub native_data_types: bool,
}
Expand description

Tudo o que é necessário para abrir uma conexão com um servidor Firebird.

Fields§

§host: String

Nome ou IP do servidor Firebird.

§port: u16

Porta TCP do servidor Firebird. O padrão do Firebird é 3050.

§database: String

Caminho ou alias do banco de dados no servidor (ex.: employee ou /data/db.fdb).

§user: String

Nome do usuário Firebird.

§password: String

Senha do usuário Firebird.

§role: Option<String>

Papel SQL opcional usado na conexão (ROLE).

§charset: String

Charset da conexão (padrão UTF8).

§dialect: i32

Dialeto SQL (padrão 3).

§wire_crypt: WireCrypt

Política de criptografia da comunicação.

§connect_timeout: Option<Duration>

Timeout de TCP + handshake.

§page_size: Option<i32>

Tamanho da página para crate::Connection::create_database.

§timezone: Option<String>

Fuso horário da sessão (FB4+), ex.: America/Sao_Paulo.

§parallel_workers: Option<i32>

Número de workers paralelos para a conexão (FB5).

§native_data_types: bool

Quando true, emite SET BIND OF INT128/DECFLOAT/TIME ZONE TO NATIVE logo após o attach (FB4+). Útil quando o servidor está com DataTypeCompatibility ligado e coage esses tipos para os legados — assim eles voltam como Int128/DecFloat/TimeTz em vez de aproximações.

Implementations§

Source§

impl ConnectConfig

Source

pub fn new() -> Self

Começa a partir dos padrões (localhost:3050, usuário SYSDBA, UTF8, dialeto 3).

Source

pub fn host(self, host: impl Into<String>) -> Self

Define o host ou IP do servidor Firebird.

Source

pub fn port(self, port: u16) -> Self

Define a porta TCP do servidor Firebird.

Source

pub fn database(self, db: impl Into<String>) -> Self

Define o banco por alias ou caminho no servidor.

Source

pub fn user(self, user: impl Into<String>) -> Self

Define o usuário Firebird.

Source

pub fn password(self, password: impl Into<String>) -> Self

Define a senha do usuário Firebird.

Source

pub fn role(self, role: impl Into<String>) -> Self

Define o papel SQL (ROLE) usado após o login.

Source

pub fn charset(self, charset: impl Into<String>) -> Self

Define o charset da conexão, como UTF8, WIN1252 ou ISO8859_1.

Source

pub fn dialect(self, dialect: i32) -> Self

Define o dialeto SQL. Use 3 para bancos modernos.

Source

pub fn wire_crypt(self, wc: WireCrypt) -> Self

Define se a comunicação deve ser criptografada, quando disponível ou obrigatoriamente.

Source

pub fn connect_timeout(self, t: Duration) -> Self

Define o tempo máximo para abrir o socket TCP e completar o handshake.

Source

pub fn page_size(self, size: i32) -> Self

Define o tamanho de página ao criar um banco novo com crate::Connection::create_database.

Source

pub fn timezone(self, tz: impl Into<String>) -> Self

Define o fuso horário da sessão, por exemplo America/Sao_Paulo.

Source

pub fn parallel_workers(self, n: i32) -> Self

Define o número de workers paralelos solicitado ao servidor Firebird 5.

Source

pub fn native_data_types(self, on: bool) -> Self

Pede os tipos nativos (INT128/DECFLOAT/WITH TIME ZONE) após o attach. Veja ConnectConfig::native_data_types.

Trait Implementations§

Source§

impl Clone for ConnectConfig

Source§

fn clone(&self) -> ConnectConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ConnectConfig

Source§

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

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

impl Default for ConnectConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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