Replies: 2 comments
-
Adding to the as-I-go list:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@ionut-arm mentioned wanting a roadmap to be able to plan around features and changes I may be submitting. I don't think I can do that in any comprehensive way because I'm a bit more opportunistic than that, just changing the thing that was in my way most recently. But I can at least try to collect ideas here that have crossed my mind.
In general I've been working from the bottom up, trying to work out the details of the low-level types first and moving gradually in the direction of the main library API.
Next-ish:
thiserror
to clean up theError
type.Error
strings to be more context-specific. (i.e, Two errors with the same source type aren't necessarily the same).derivative
crate. Its only used in one place where a customDebug
impl will do. My real motive, though, is that it does some things that make rust-analyzer incorrectly mark it with a red squiggly, which is annoying. 😛AttributeType
in favor of justAttribute
.CKA_VENDOR_DEFINED
and set a general pattern for other vendor definitions.Date
type to resemble theUtcTime
type in Info flags refactor #68. Likely also move it out oftypes
and intoobject
since it isn't used elsewhere."As I go" items I'll change as I encounter them but are too spread out for their own PR:
From
orTryFrom
conversion at the struct level rather than converting inside getters.MyStruct{ var: CK_ULONG }
should just beMyStruct(CK_ULONG)
.From
from docs and replacing the largestringify
blocks with Debug impls of Rust types.types
module. For instance, I put theMaybeUnavailable
trait there because I thought it might need use in multiple places. But if that doesn't materialize, it should be moved back nearTokenInfo
, the only place it's used now.Bigger, speculative ideas that may become more or less unrealistic as other changes progress:
Thing
andThingInfo
type pairs. It's strange that many types have a secondary info type. To just have something that can act as both a handle/ID as well as describe itself seems much more intuitive. (Slot
looks especially absurd in this regard.) I haven't thought through all the implications of such a change, though. For one, it would make allget_info
kinds of calls implicit whenever the thing being described is constructed. Also, any dynamic state (e.g., clock value) would have to be managed in a new way. Lots of other stuff I'm probably not thinking of, too.Arc
of lib to spread context callback access into other types. Use lifetime of theSession
that provides them to prevent use after close.use cryptoki_sys::*
globs with an explicit list of bindings. This is more curiosity than anything. I'd like to dig into how the import process works and whether there's anything to be gained by not having this massive file fully in scope.Beta Was this translation helpful? Give feedback.
All reactions