pub struct CdpPool { /* private fields */ }Expand description
CDP 连接池
管理多个 CDP 端点,支持随机、轮询、故障转移策略。
实现 HttpClient trait,可直接用于 CompositeFetcher。
Implementations§
Source§impl CdpPool
impl CdpPool
Sourcepub fn builder() -> CdpPoolBuilder
pub fn builder() -> CdpPoolBuilder
创建 Builder
Sourcepub async fn healthy_count(&self) -> usize
pub async fn healthy_count(&self) -> usize
获取当前健康端点数量
Sourcepub async fn total_count(&self) -> usize
pub async fn total_count(&self) -> usize
获取端点总数
Trait Implementations§
Source§impl HttpClient for CdpPool
impl HttpClient for CdpPool
Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
headers: &'life2 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
headers: &'life2 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
发送 GET 请求
Source§fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
headers: &'life2 HashMap<String, String>,
_body: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
headers: &'life2 HashMap<String, String>,
_body: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
发送 POST 请求
Auto Trait Implementations§
impl !Freeze for CdpPool
impl !RefUnwindSafe for CdpPool
impl !UnwindSafe for CdpPool
impl Send for CdpPool
impl Sync for CdpPool
impl Unpin for CdpPool
impl UnsafeUnpin for CdpPool
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