pub struct LocalRef<'id, T: Sync + 'static> { /* private fields */ }
Expand description
A thread-safe pointer to a thread-local Context
constrained by a “generative” lifetime brand that is invariant over the lifetime parameter and cannot be coerced into 'static
Implementations§
Source§impl<'id, T> LocalRef<'id, T>where
T: Sync + 'static,
impl<'id, T> LocalRef<'id, T>where
T: Sync + 'static,
Sourcepub fn with_blocking<F, R>(self, f: F) -> JoinHandle<R>
Available on crate feature rt
only.
pub fn with_blocking<F, R>(self, f: F) -> JoinHandle<R>
rt
only.A wrapper around tokio::task::spawn_blocking
that safely constrains the lifetime of LocalRef
Trait Implementations§
Source§impl<'id, T: Ord + Sync + 'static> Ord for LocalRef<'id, T>
impl<'id, T: Ord + Sync + 'static> Ord for LocalRef<'id, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'id, T: PartialOrd + Sync + 'static> PartialOrd for LocalRef<'id, T>
impl<'id, T: PartialOrd + Sync + 'static> PartialOrd for LocalRef<'id, T>
impl<'id, T: Eq + Sync + 'static> Eq for LocalRef<'id, T>
impl<T> Send for LocalRef<'_, T>where
T: Sync,
impl<'id, T: Sync + 'static> StructuralPartialEq for LocalRef<'id, T>
impl<T> Sync for LocalRef<'_, T>where
T: Sync,
Auto Trait Implementations§
impl<'id, T> Freeze for LocalRef<'id, T>
impl<'id, T> RefUnwindSafe for LocalRef<'id, T>where
T: RefUnwindSafe,
impl<'id, T> Unpin for LocalRef<'id, T>
impl<'id, T> UnwindSafe for LocalRef<'id, T>where
T: RefUnwindSafe,
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