Struct br_db::config::Connection

source ·
pub struct Connection {
Show 13 fields pub mode: Mode, pub hostname: String, pub hostport: String, pub database: String, pub username: String, pub userpass: String, pub params: Vec<String>, pub charset: Charset, pub prefix: String, pub debug: bool, pub backup_time: String, pub backup_path: PathBuf, pub backup_number: u8,
}
Expand description

数据库连接

Fields§

§mode: Mode§hostname: String

连接地址

§hostport: String

连接端口

§database: String

数据库名称

§username: String

账号

§userpass: String

密码

§params: Vec<String>§charset: Charset

数据库语言

§prefix: String

表前缀

§debug: bool

调试开关

§backup_time: String

备份时间

          • command to be executed

| | | | | | | | | +—– 星期几 (0 - 7) (0 和 7 都代表星期日) | | | +—–– 月份 (1 - 12) | | +——— 日期 (1 - 31) | +———– 小时 (0 - 23) +———–– 分钟 (0 - 59)

*:代表任何值。
•	,:用于分隔多个值。
•	-:用于表示范围。
•	/:用于指定步长。
§backup_path: PathBuf

备份路径

§backup_number: u8

备份保留数量

Implementations§

source§

impl Connection

source

pub fn default() -> Connection

source

pub fn json(&mut self) -> JsonValue

source

pub fn from(&mut self, data: JsonValue) -> &mut Connection

source

pub fn get_dsn(self) -> String

Trait Implementations§

source§

impl Clone for Connection

source§

fn clone(&self) -> Connection

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 Connection

source§

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

Formats the value using the given formatter. 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<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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, 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.