Struct tokio::task::local::LocalState
source · struct LocalState {
owner: ThreadId,
local_queue: UnsafeCell<VecDeque<Notified<Arc<Shared>>>>,
owned: LocalOwnedTasks<Arc<Shared>>,
}
Expand description
Tracks the LocalSet
state that must only be accessed from the thread that
created the LocalSet
.
Fields§
§owner: ThreadId
The ThreadId
of the thread that owns the LocalSet
.
local_queue: UnsafeCell<VecDeque<Notified<Arc<Shared>>>>
Local run queue sender and receiver.
owned: LocalOwnedTasks<Arc<Shared>>
Collection of all active tasks spawned onto this executor.
Implementations§
source§impl LocalState
impl LocalState
unsafe fn task_pop_front(&self) -> Option<Notified<Arc<Shared>>>
unsafe fn task_push_back(&self, task: Notified<Arc<Shared>>)
unsafe fn take_local_queue(&self) -> VecDeque<Notified<Arc<Shared>>>
unsafe fn task_remove( &self, task: &Task<Arc<Shared>>, ) -> Option<Task<Arc<Shared>>>
sourceunsafe fn owned_is_empty(&self) -> bool
unsafe fn owned_is_empty(&self) -> bool
Returns true if the LocalSet
does not have any spawned tasks
unsafe fn assert_owner( &self, task: Notified<Arc<Shared>>, ) -> LocalNotified<Arc<Shared>>
unsafe fn close_and_shutdown_all(&self)
fn assert_called_from_owner_thread(&self)
Trait Implementations§
impl Send for LocalState
Auto Trait Implementations§
impl !Freeze for LocalState
impl !RefUnwindSafe for LocalState
impl !Sync for LocalState
impl Unpin for LocalState
impl !UnwindSafe for LocalState
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