Struct tokio::runtime::park::CachedParkThread
source · pub(crate) struct CachedParkThread {
_anchor: PhantomData<Rc<()>>,
}
Expand description
Blocks the current thread using a condition variable.
Fields§
§_anchor: PhantomData<Rc<()>>
Implementations§
source§impl CachedParkThread
impl CachedParkThread
sourcepub(crate) fn new() -> CachedParkThread
pub(crate) fn new() -> CachedParkThread
Creates a new ParkThread
handle for the current thread.
This type cannot be moved to other threads, so it should be created on the thread that the caller intends to park.
pub(crate) fn waker(&self) -> Result<Waker, AccessError>
fn unpark(&self) -> Result<UnparkThread, AccessError>
pub(crate) fn park(&mut self)
pub(crate) fn park_timeout(&mut self, duration: Duration)
sourcefn with_current<F, R>(&self, f: F) -> Result<R, AccessError>where
F: FnOnce(&ParkThread) -> R,
fn with_current<F, R>(&self, f: F) -> Result<R, AccessError>where
F: FnOnce(&ParkThread) -> R,
Gets a reference to the ParkThread
handle for this thread.
pub(crate) fn block_on<F: Future>( &mut self, f: F, ) -> Result<F::Output, AccessError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CachedParkThread
impl RefUnwindSafe for CachedParkThread
impl !Send for CachedParkThread
impl !Sync for CachedParkThread
impl Unpin for CachedParkThread
impl UnwindSafe for CachedParkThread
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