pub struct SimpleTls<T: Copy + Send> { /* private fields */ }
Expand description
A container for simple thread local storage.
This will maintain a mapping between Zephyr threads and a value of type T. Entries will have to be added manually, generally when each thread is started.
Note that T must implement Copy, as it is not safe to retain references to the inner data outside of this api.
T must also implement Send, since although ‘get’ always retrieves the current thread’s data,
insert
will typically need to move T
across threads.
Implementations§
Auto Trait Implementations§
impl<T> Freeze for SimpleTls<T>
impl<T> RefUnwindSafe for SimpleTls<T>where
T: RefUnwindSafe,
impl<T> Send for SimpleTls<T>
impl<T> Sync for SimpleTls<T>where
T: Sync,
impl<T> Unpin for SimpleTls<T>where
T: Unpin,
impl<T> UnwindSafe for SimpleTls<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