#[repr(transparent)]pub struct Identity<T>(pub T);Expand description
A wrapper making one of the identity statics shareable.
asdf_version_t and asdf_software_t hold raw pointers, so they are not
Sync in general — a heap-allocated one from asdf_version_parse is the
caller’s to manage. The two statics below are different: every pointer in
them refers to a string literal, and nothing ever writes to them, so
sharing them across threads is sound. repr(transparent) keeps the
exported symbol byte-identical to the bare struct.
Tuple Fields§
§0: TTrait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Identity<T>where
T: Freeze,
impl<T> RefUnwindSafe for Identity<T>where
T: RefUnwindSafe,
impl<T> Send for Identity<T>where
T: Send,
impl<T> Unpin for Identity<T>where
T: Unpin,
impl<T> UnsafeUnpin for Identity<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Identity<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