pub struct NotifyError {
pub kind: NotifyErrorKind,
pub retry: RetrySafety,
}Expand description
脱敏错误,只描述稳定分类及重试证据。
Fields§
§kind: NotifyErrorKind不含凭据、URL 或响应正文的失败分类。
retry: RetrySafety是否有明确证据允许重试,默认不允许。
Implementations§
Source§impl NotifyError
impl NotifyError
Sourcepub const fn new(kind: NotifyErrorKind) -> Self
pub const fn new(kind: NotifyErrorKind) -> Self
业务作用:构造不能安全重发的通知失败。
参数说明:
kind:是不含原始响应的分类。
返回:默认禁止重试的错误。
Sourcepub const fn retryable(
kind: NotifyErrorKind,
retry_after: Option<Duration>,
) -> Self
pub const fn retryable( kind: NotifyErrorKind, retry_after: Option<Duration>, ) -> Self
业务作用:声明连接未发送或服务明确拒绝后的安全重试。
参数说明:
kind:为分类retry_after:为服务要求的最小等待。
返回:携带重试证据的错误,仍受宿主总预算限制。
Trait Implementations§
Source§impl Clone for NotifyError
impl Clone for NotifyError
impl Copy for NotifyError
Source§impl Debug for NotifyError
impl Debug for NotifyError
Source§impl Display for NotifyError
impl Display for NotifyError
impl Eq for NotifyError
Source§impl Error for NotifyError
impl Error for NotifyError
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 PartialEq for NotifyError
impl PartialEq for NotifyError
impl StructuralPartialEq for NotifyError
Auto Trait Implementations§
impl Forget for NotifyError
impl Freeze for NotifyError
impl Move for NotifyError
impl RefUnwindSafe for NotifyError
impl Send for NotifyError
impl Sync for NotifyError
impl Unpin for NotifyError
impl UnsafeUnpin for NotifyError
impl UnwindSafe for NotifyError
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