pub struct ConnectionPolicy {
pub startup_required: bool,
pub request_timeout_ms: u64,
pub poll_interval_ms: u64,
pub max_age_ms: u64,
pub stale_if_error_ms: u64,
pub idle_timeout_ms: u64,
pub initial_backoff_ms: u64,
pub max_backoff_ms: u64,
}Expand description
单个连接的准备、查询、证据时效和回收预算。
Fields§
§startup_required: bool是否要求启动阶段确认成功;失败时阻止宿主完成启动。
request_timeout_ms: u64一次请求的最大耗时,单位为毫秒。
poll_interval_ms: u64后台轮询间隔,单位为毫秒,必须留出请求和证据时效预算。
max_age_ms: u64发现证据的最大年龄,单位为毫秒。
stale_if_error_ms: u64查询异常后的旧证据宽限,单位为毫秒;零表示禁止异常复用。
idle_timeout_ms: u64无人使用的服务观察保留时长,单位为毫秒。
initial_backoff_ms: u64连接恢复的初始退避,单位为毫秒。
max_backoff_ms: u64连接恢复退避的上限,单位为毫秒。
Implementations§
Trait Implementations§
Source§impl Clone for ConnectionPolicy
impl Clone for ConnectionPolicy
Source§impl Debug for ConnectionPolicy
impl Debug for ConnectionPolicy
Source§impl Default for ConnectionPolicy
impl Default for ConnectionPolicy
Source§impl<'de> Deserialize<'de> for ConnectionPolicywhere
ConnectionPolicy: Default,
impl<'de> Deserialize<'de> for ConnectionPolicywhere
ConnectionPolicy: Default,
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 Forget for ConnectionPolicy
impl Freeze for ConnectionPolicy
impl Move for ConnectionPolicy
impl RefUnwindSafe for ConnectionPolicy
impl Send for ConnectionPolicy
impl Sync for ConnectionPolicy
impl Unpin for ConnectionPolicy
impl UnsafeUnpin for ConnectionPolicy
impl UnwindSafe for ConnectionPolicy
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