pub struct GraphConfig {
pub dsn: String,
pub connect_timeout_secs: u64,
pub query_timeout_secs: u64,
pub max_pool_size: usize,
}Expand description
图数据库连接配置
Fields§
§dsn: StringBolt DSN,如 neo4j://neo4j:password@127.0.0.1:7687
connect_timeout_secs: u64连接超时(秒)
query_timeout_secs: u64查询超时(秒)
max_pool_size: usize连接池最大大小
Implementations§
Source§impl GraphConfig
impl GraphConfig
pub fn new(dsn: &str) -> Self
pub fn with_connect_timeout(self, secs: u64) -> Self
pub fn with_query_timeout(self, secs: u64) -> Self
pub fn with_pool_size(self, size: usize) -> Self
Sourcepub fn sanitized_dsn(&self) -> String
pub fn sanitized_dsn(&self) -> String
脱敏的 DSN(不泄露密码)
Source§impl GraphConfig
impl GraphConfig
pub fn connect_timeout(&self) -> Duration
pub fn query_timeout(&self) -> Duration
Trait Implementations§
Source§impl Clone for GraphConfig
impl Clone for GraphConfig
Source§fn clone(&self) -> GraphConfig
fn clone(&self) -> GraphConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GraphConfig
impl RefUnwindSafe for GraphConfig
impl Send for GraphConfig
impl Sync for GraphConfig
impl Unpin for GraphConfig
impl UnsafeUnpin for GraphConfig
impl UnwindSafe for GraphConfig
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