You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's ensure that the library follows the official API guidelines (although I suspect it does on almost all accounts). I've posted the checklist below, and will try to fill it out as I see fit (opening issues for non-resolved items).
Note: Ordering traits would perhaps be ill-advised, as most of these are pointers, and the actual ordering would be rather unexpected?
Note: Display is probably undesired, since we don't pull in the libraries to give a proper description of the handles.
Conversions use the standard traits From, AsRef, AsMut (C-CONV-TRAITS)
Collections implement FromIterator and Extend (C-COLLECT)
Data structures implement Serde's Serialize, Deserialize (C-SERDE)
Note: Window handles cannot and should not be serialized or deserialized, especially not from disk; they are ephemeral, and very much tied to the lifetime of the program!
Types are Send and Sync where possible (C-SEND-SYNC)
Note: It's usually impossible to check if a pointer is valid, so we just have to assume it is; that's why it's unsafe!
Note: We could verify the integer handles, but that would introduce dependencies into this crate, while avoiding those is part of the reason to have it in the first place.
Heh, I've been working on this issue for the past hour, that's why there's only two missing. But I guess I'll just post my thoughts here, and be done with it.
Re private fields:
It might actually make sense for e.g. the error enum, e.g. add a pub struct NotSupported(());, and then require that in HandleError::NotSupported(NotSupported::default()), in case we wanted the ability to add more information later.
But I suppose that the error type is #[non_exhaustive], so we could add more information that way, and besides, we should rather do #143 if we're concerned about extensibility in the error type.
Re public deps:
This was being considered in #134, so I wanted to ensure that we didn't release v1.0 before the dependency did that; but then I read it again, and realised that @notgull already considered that, so I don't think I need to worry about it.
Let's ensure that the library follows the official API guidelines (although I suspect it does on almost all accounts). I've posted the checklist below, and will try to fill it out as I see fit (opening issues for non-resolved items).
Rust API Guidelines Checklist
as_
,to_
,into_
conventions (C-CONV)iter
,iter_mut
,into_iter
(C-ITER)Copy
,Clone
,Eq
,PartialEq
,Ord
,PartialOrd
,Hash
,Debug
,Display
,Default
Copy
, see DoesRawWindowHandle
need to beCopy
? #138.Display
is probably undesired, since we don't pull in the libraries to give a proper description of the handles.From
,AsRef
,AsMut
(C-CONV-TRAITS)FromIterator
andExtend
(C-COLLECT)Serialize
,Deserialize
(C-SERDE)Send
andSync
where possible (C-SEND-SYNC)RawWindowHandle
implementSend
? #85.Hex
,Octal
,Binary
formatting (C-NUM-FMT)R: Read
andW: Write
by value (C-RW-VALUE)?
, nottry!
, notunwrap
(C-QUESTION-MARK)keywords, categories
Cargo.toml
#148Deref
andDerefMut
(C-DEREF)bool
orOption
(C-CUSTOM-TYPE)bitflags
, not enums (C-BITFLAG)unsafe
!Debug
(C-DEBUG)Debug
representation is never empty (C-DEBUG-NONEMPTY)The text was updated successfully, but these errors were encountered: