pub struct NetworkError {
pub op: String,
pub url: String,
pub cause: String,
pub timeout: bool,
pub eof: bool,
}Expand description
结构化网络层错误(传输失败,区别于上游业务错误)。对应 TS NetworkError。
Fields§
§op: String操作描述,例如 "POST /v1/messages"。
url: String请求 URL(脱敏后)。
cause: String底层 cause 的消息(已解析为字符串)。
timeout: bool§eof: boolImplementations§
Trait Implementations§
Source§impl Clone for NetworkError
impl Clone for NetworkError
Source§impl Debug for NetworkError
impl Debug for NetworkError
Source§impl Display for NetworkError
impl Display for NetworkError
Source§impl Error for NetworkError
impl Error for NetworkError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<NetworkError> for Error
impl From<NetworkError> for Error
Source§fn from(source: NetworkError) -> Self
fn from(source: NetworkError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NetworkError
impl RefUnwindSafe for NetworkError
impl Send for NetworkError
impl Sync for NetworkError
impl Unpin for NetworkError
impl UnsafeUnpin for NetworkError
impl UnwindSafe for NetworkError
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