#[repr(transparent)]pub struct HostPointer(pub *const c_void);Expand description
A raw host address recorded from an ɴsɪ Reference argument.
§Safety
Send and Sync are asserted on two grounds, both structural
rather than hopeful:
- The recorder never dereferences it. A
HostPointeris stored on the way in and handed back on the way out, nothing else. No data race is possible through a pointer that is never read. - The pointee outlives everything. The recorder’s
Nsiimpl declaresArg<'call, 'static>, so the onlyReferenceit can be handed is one whose data is'static. That is the same rulensi-ffi-wrapapplies –Reference,CallbackandReferenceSliceareSend/Syncat'staticand nowhere else.
The assertion lives on this newtype rather than on Recorder so it
covers exactly the field that needs it. A blanket
unsafe impl Send for Recorder would silently keep covering any
non-Send field added later.
Tuple Fields§
§0: *const c_voidTrait Implementations§
Source§impl Clone for HostPointer
impl Clone for HostPointer
impl Copy for HostPointer
Source§impl Debug for HostPointer
impl Debug for HostPointer
impl Eq for HostPointer
Source§impl Hash for HostPointer
impl Hash for HostPointer
Source§impl PartialEq for HostPointer
impl PartialEq for HostPointer
impl Send for HostPointer
impl StructuralPartialEq for HostPointer
impl Sync for HostPointer
Auto Trait Implementations§
impl Forget for HostPointer
impl Freeze for HostPointer
impl Move for HostPointer
impl RefUnwindSafe for HostPointer
impl Unpin for HostPointer
impl UnsafeUnpin for HostPointer
impl UnwindSafe for HostPointer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.