Skip to content

Commit 74af1fe

Browse files
committed
breaking: Remove HasRawXHandle traits
This commit removes the HasRawWindowHandle trait as well as the HasRawDisplayHandle trait. These have been deprecated since version 0.6.0. Ref: #177 Signed-off-by: John Nunley <dev@notgull.net>
1 parent 7539aef commit 74af1fe

2 files changed

Lines changed: 2 additions & 59 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* **Breaking:** Rework web handles to remove `wasm-bindgen` from public API. (#184)
66
- **Breaking:** Remove `WebWindowHandle` as it is no longer used. (#186)
7+
- **Breaking:** Remove deprecated `HasRawWindowHandle` and `HasRawDisplayHandle` traits.
78
* Improve documentation on AppKit and UIKit handles.
89
* Deprecated `UiKitWindowHandle::ui_view_controller`, retrieve this from the UIView's responder chain instead.
910

src/lib.rs

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -60,32 +60,6 @@ pub use windows::{Win32WindowHandle, WinRtWindowHandle, WindowsDisplayHandle};
6060

6161
use core::fmt;
6262

63-
/// Window that wraps around a raw window handle.
64-
///
65-
/// # Safety
66-
///
67-
/// Users can safely assume that pointers and non-zero fields are valid, and it is up to the
68-
/// implementer of this trait to ensure that condition is upheld.
69-
///
70-
/// Despite that qualification, implementers should still make a best-effort attempt to fill in all
71-
/// available fields. If an implementation doesn't, and a downstream user needs the field, it should
72-
/// try to derive the field from other fields the implementer *does* provide via whatever methods the
73-
/// platform provides.
74-
///
75-
/// The exact handles returned by `raw_window_handle` must remain consistent between multiple calls
76-
/// to `raw_window_handle` as long as not indicated otherwise by platform specific events.
77-
#[deprecated = "Use `HasWindowHandle` instead"]
78-
pub unsafe trait HasRawWindowHandle {
79-
fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError>;
80-
}
81-
82-
#[allow(deprecated)]
83-
unsafe impl<T: HasWindowHandle + ?Sized> HasRawWindowHandle for T {
84-
fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError> {
85-
self.window_handle().map(Into::into)
86-
}
87-
}
88-
8963
/// A window handle for a particular windowing system.
9064
///
9165
/// Each variant contains a struct with fields specific to that windowing system
@@ -202,32 +176,6 @@ pub enum RawWindowHandle {
202176
Haiku(HaikuWindowHandle),
203177
}
204178

205-
/// Display that wraps around a raw display handle.
206-
///
207-
/// # Safety
208-
///
209-
/// Users can safely assume that pointers and non-zero fields are valid, and it is up to the
210-
/// implementer of this trait to ensure that condition is upheld.
211-
///
212-
/// Despite that qualification, implementers should still make a best-effort attempt to fill in all
213-
/// available fields. If an implementation doesn't, and a downstream user needs the field, it should
214-
/// try to derive the field from other fields the implementer *does* provide via whatever methods the
215-
/// platform provides.
216-
///
217-
/// The exact handles returned by `raw_display_handle` must remain consistent between multiple calls
218-
/// to `raw_display_handle` as long as not indicated otherwise by platform specific events.
219-
#[deprecated = "Use `HasDisplayHandle` instead"]
220-
pub unsafe trait HasRawDisplayHandle {
221-
fn raw_display_handle(&self) -> Result<RawDisplayHandle, HandleError>;
222-
}
223-
224-
#[allow(deprecated)]
225-
unsafe impl<T: HasDisplayHandle + ?Sized> HasRawDisplayHandle for T {
226-
fn raw_display_handle(&self) -> Result<RawDisplayHandle, HandleError> {
227-
self.display_handle().map(Into::into)
228-
}
229-
}
230-
231179
/// A display server handle for a particular windowing system.
232180
///
233181
/// The display usually represents a connection to some display server, but it is not necessarily
@@ -480,11 +428,5 @@ mod tests {
480428
}
481429

482430
#[allow(deprecated, unused)]
483-
fn assert_object_safe(
484-
_: &dyn HasRawWindowHandle,
485-
_: &dyn HasRawDisplayHandle,
486-
_: &dyn HasWindowHandle,
487-
_: &dyn HasDisplayHandle,
488-
) {
489-
}
431+
fn assert_object_safe(_: &dyn HasWindowHandle, _: &dyn HasDisplayHandle) {}
490432
}

0 commit comments

Comments
 (0)