pub struct IotdbConfig {
pub base_url: String,
pub username: String,
pub password: String,
pub tls: Option<TlsClientConfig>,
pub query_timeout_secs: Option<u64>,
pub breaker: Option<BreakerConfig>,
pub max_concurrency: Option<usize>,
}Fields§
§base_url: String§username: String§password: String§tls: Option<TlsClientConfig>§query_timeout_secs: Option<u64>单次调用超时秒数。0 = 禁用;未配置 = 30 秒。
这是外层预算,与 reqwest 自带的总超时(from_config 建的 client 有
30 秒、new 没有)取先到者。
breaker: Option<BreakerConfig>熔断配置;省略则用保守默认(失败率 0.5、窗口 30 秒、打开 10 秒)。
熔断默认开启 —— 保守阈值下只在持续失败时打开。当前没有总开关:
BreakerConfig 只有阈值字段,没有 enabled(不许写 {"enabled": false}:
那是反序列化错误,或被 #[serde(default)] 静默吞掉后以为关掉了)。
真要停用,只能把阈值调到不可能触发(如 failure_ratio: 1.1)。
max_concurrency: Option<usize>并发上限。0 = 不限并发(与 query_timeout_secs: 0 = 禁用同构);
未配置 = 32。
reqwest 只有 pool_max_idle_per_host(空闲保留数),没有「最大总连接数」
—— 默认无上限意味着并发无背压。上限由本 crate 的信号量实现,不是 reqwest 的旋钮。
Trait Implementations§
Source§impl Clone for IotdbConfig
impl Clone for IotdbConfig
Source§impl Debug for IotdbConfig
impl Debug for IotdbConfig
Source§impl<'de> Deserialize<'de> for IotdbConfig
impl<'de> Deserialize<'de> for IotdbConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IotdbConfig
impl RefUnwindSafe for IotdbConfig
impl Send for IotdbConfig
impl Sync for IotdbConfig
impl Unpin for IotdbConfig
impl UnsafeUnpin for IotdbConfig
impl UnwindSafe for IotdbConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request