pub struct MeshStreamHandle { /* private fields */ }Expand description
FFI handle for an open stream against a MeshNode.
HandleGuard-protected. Without it, two distinct UAFs can
fire: _node: Arc<MeshNode> keeps the underlying node alive
but not the MeshStreamHandle Box itself —
net_mesh_free(node_handle) could deallocate the node
handle’s box while net_mesh_send was deref’ing
&*node_handle for the Arc::ptr_eq check in
handles_match. The same hazard applies to this stream
handle’s own box: a concurrent net_mesh_stream_free while
net_mesh_send was reading sh.stream / sh._node would
UAF the dropped fields. The guard closes both: the box stays
leaked across _free; ops register via try_enter and
_free quiesces them via begin_free.
Auto Trait Implementations§
impl !Freeze for MeshStreamHandle
impl !RefUnwindSafe for MeshStreamHandle
impl Send for MeshStreamHandle
impl Sync for MeshStreamHandle
impl Unpin for MeshStreamHandle
impl UnsafeUnpin for MeshStreamHandle
impl !UnwindSafe for MeshStreamHandle
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