Struct TryCurrentError
pub struct TryCurrentError { /* private fields */ }
Available on crate feature
rt only.Error returned by try_current when no Runtime has been started
Implementations
impl TryCurrentError
pub fn is_missing_context(&self) -> bool
Returns true if the call failed because there is currently no runtime in the Tokio context.
pub fn is_thread_local_destroyed(&self) -> bool
Returns true if the call failed because the Tokio context thread-local had been destroyed. This can usually only happen if in the destructor of other thread-locals.
Trait Implementations
impl Debug for TryCurrentError
impl Display for TryCurrentError
impl Error for TryCurrentError
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations
impl Freeze for TryCurrentError
impl RefUnwindSafe for TryCurrentError
impl Send for TryCurrentError
impl Sync for TryCurrentError
impl Unpin for TryCurrentError
impl UnsafeUnpin for TryCurrentError
impl UnwindSafe for TryCurrentError
Blanket Implementations
impl<T> BorrowMut<T> for Twhere T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Instrument for T
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> ToString for T
impl<T> WithSubscriber for T
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
MIT License
Copyright © Tokio Contributors
https://docs.rs/tokio/1.53.1/tokio/runtime/struct.TryCurrentError.html