pub trait LocalMutexLike<T: 'static> {
type Guard<'guard>: DerefMut<Target = T>
where Self: 'guard;
// Required method
fn lock(&self) -> impl Future<Output = Self::Guard<'_>>;
}Expand description
Non-Send mutex shape for runtimes that pin tasks to a
single core. The guard is !Send so callers can’t accidentally
move it across cores; in exchange the underlying primitive can
skip the atomic/notification dance a Send Mutex needs.
Implementations are typically Rc<RefCell<T>>-shaped plus a
per-core VecDeque<Waker> waiter queue. Not exposed on
RuntimeFactory because tokio’s multi-thread runtime can’t
honor the !Send guard contract — LocalRuntimeFactory is a
separate opt-in for prime-style per-core-pinned runtimes.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".