Expand description
网络模块
提供代理、超时、重试等网络功能
Structs§
- Abort
Error - 取消错误
- Parsed
Proxy Url - 解析后的代理 URL
- Proxy
Agent Options - 代理 Agent 选项
- Proxy
Config - 代理配置
- Proxy
Info - 代理信息
- Retry
Config - 重试配置
- Retry
Error - 重试错误信息
- Timeout
Config - 超时配置
- Timeout
Error - 超时错误
Enums§
- Timeout
OrAbort Error - 超时或取消错误
Constants§
- DEFAULT_
RETRY_ CONFIG - 默认重试配置
- DEFAULT_
TIMEOUTS - 默认超时配置
Functions§
- build_
proxy_ url_ with_ auth - 构建带认证的代理 URL
- calculate_
retry_ delay - 计算重试延迟
- cancelable_
delay - 可取消的延迟
- connect_
timeout_ duration - 创建连接超时 Duration
- get_
proxy_ for_ url - 获取目标 URL 的代理 URL
- get_
proxy_ from_ env - 从环境变量读取代理配置
- get_
proxy_ info - 获取代理信息(用于调试)
- get_
reqwest_ proxy - 获取 reqwest 代理配置
- is_
abort_ error - 检查错误是否为取消错误
- is_
retryable_ error - 判断错误是否可重试
- is_
timeout_ error - 检查错误是否为超时错误
- parse_
proxy_ url - 解析代理 URL,提取认证信息
- retry
- 简化的重试函数
- should_
bypass_ proxy - 检查 URL 是否应该绕过代理
- timeout_
duration - 创建超时 Duration
- with_
retry - 执行带重试的操作
- with_
timeout - 带超时执行异步操作
- with_
timeout_ and_ cancel - 带超时和取消执行异步操作