Struct SendError
pub struct SendError<T> { /* private fields */ }Expand description
携带原值的交值错误(send error)。
使用 Self::kind 读取原因,或用 Self::into_parts 取回同一个原值。
显示(Display)和调试(Debug)均只描述原因,不读取或格式化原值。
普通交值不因本错误而要求值实现 Debug、Display、Clone 或 'static。
将本错误装入报告(Report)时,仍须满足报告自身的线程和生命周期约束。
Implementations§
Source§impl<T> SendError<T>
impl<T> SendError<T>
Sourcepub fn kind(&self) -> SendErrorKind
pub fn kind(&self) -> SendErrorKind
读取本次交值失败的固定原因,不消费原值。
Sourcepub fn into_parts(self) -> (SendErrorKind, T)
pub fn into_parts(self) -> (SendErrorKind, T)
消耗本错误,一并取得失败原因和同一个原值。
原值归调用者后,其使用和析构(drop)由调用者负责。
Trait Implementations§
Source§impl<T> Error for SendError<T>
impl<T> Error for SendError<T>
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()
Auto Trait Implementations§
impl<T> Forget for SendError<T>
impl<T> Freeze for SendError<T>where
T: Freeze,
impl<T> Move for SendError<T>
impl<T> RefUnwindSafe for SendError<T>where
T: RefUnwindSafe,
impl<T> Send for SendError<T>where
T: Send,
impl<T> Sync for SendError<T>where
T: Sync,
impl<T> Unpin for SendError<T>where
T: Unpin,
impl<T> UnsafeUnpin for SendError<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SendError<T>where
T: UnwindSafe,
Blanket Implementations§
impl<T> Attachment for T
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