Closed terrybrash closed 8 years ago
Typically I've been following the principle of wrapping winapi types in safe wrappers. So instead of working with a console HANDLE
directly, I have it wrapped up in a ScreenBuffer
. Instead of handing out a COORD
, I'd give out (i16, i16)
, although I really ought to change that to be two structs Point
and Size
. You seem to have a lot of freestanding functions which take and return raw things directly, so it would definitely take a bit of refactoring to get it into the style I've been going for. You're free to do so if you want.
You're right; I don't think my code will fit then.
My goals are to:
For my purposes, I don't mind working with the raw types directly. I just needed a safe way to work with them.
I've got my own safe wrappers for winapi-rs: https://github.com/brashaw/C4/blob/master/src/win32/safe.rs
I will clean it up and move it into wio-rs if it's welcome.