#[repr(transparent)]pub struct Unaware<T>(pub T);Expand description
Allows transferring a value that doesn’t implement ThreadAware
Since the ThreadAware trait is not commonly implemented, this wrapper can
be used to allow transferring values that don’t implement ThreadAware.
Care must be taken when using this type - since the value will be moved
as is, if it contains shared references to data other threads may use,
it can introduce contention, resulting in performance impact. As a rule
of thumb, if the wrapped value contains an Arc with interior mutability
somewhere inside, this wrapper should not be used, and a PerCore or PerNuma
with independent initialization per affinity is a better option.
Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<T> ThreadAware for Unaware<T>
impl<T> ThreadAware for Unaware<T>
Source§fn relocated(
self,
_source: MemoryAffinity,
_destination: PinnedAffinity,
) -> Self
fn relocated( self, _source: MemoryAffinity, _destination: PinnedAffinity, ) -> Self
Consume a value and return a value in the destination affinity. Read more
impl<T: Copy> Copy for Unaware<T>
impl<T: Eq> Eq for Unaware<T>
impl<T> StructuralPartialEq for Unaware<T>
Auto Trait Implementations§
impl<T> Freeze for Unaware<T>where
T: Freeze,
impl<T> RefUnwindSafe for Unaware<T>where
T: RefUnwindSafe,
impl<T> Send for Unaware<T>where
T: Send,
impl<T> Sync for Unaware<T>where
T: Sync,
impl<T> Unpin for Unaware<T>where
T: Unpin,
impl<T> UnwindSafe for Unaware<T>where
T: UnwindSafe,
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