pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
pub fn deadline(&self) -> Option<Instant>
pub fn done(&self) -> DoneHandle
Sourcepub fn done_async(&self) -> DoneFuture ⓘ
pub fn done_async(&self) -> DoneFuture ⓘ
异步版 Done:返回一个 Future,在 Context 完成时立即 ready;Never 时永 pending。
pub fn err(&self) -> Option<ContextError>
pub fn cause(&self) -> Option<Arc<dyn Error + Send + Sync>>
pub fn value(&self, key: &dyn ValueKey) -> Option<Arc<dyn Any + Send + Sync>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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