ZIm/crates/gpui/src/platform/windows/wrapper.rs
2025-08-09 23:48:58 +02:00

25 lines
468 B
Rust

use std::ops::Deref;
use windows::Win32::UI::WindowsAndMessaging::HCURSOR;
#[derive(Debug, Clone, Copy)]
pub(crate) struct SafeCursor {
raw: HCURSOR,
}
unsafe impl Send for SafeCursor {}
unsafe impl Sync for SafeCursor {}
impl From<HCURSOR> for SafeCursor {
fn from(value: HCURSOR) -> Self {
SafeCursor { raw: value }
}
}
impl Deref for SafeCursor {
type Target = HCURSOR;
fn deref(&self) -> &Self::Target {
&self.raw
}
}