API Changes
Things that I want to do better for the 1.0.0
release. I'm not about to release that though, I want to iterate on this library for a while. If anybody wants to I'm happy to let somebody have a crack at this issue.
-
Move the implementations of Display
andFromStr
into some internal traits so that they're not exposed in the API. Parsing these library types are implementation details that this library should be abstracting away. -
MakeGroup
unconstructable and add anew
method forUser
andGroup
that allows easy-ish construction. Along with this, refactor theAllGroups::add_group
andAllUsers::add_user
so that they just take aUser
or aGroup
. This should simplify the API and make it more consistent. Also allows for more efficient use of the library.- An alternative to a new function would be a builder pattern, probably using a new type (
UserBuilder
/GroupBuilder
), which would ensure that all their inputs are valid before building a new user. Might be nice to implement construction asUser::builder() -> UserBuilder
for ergonomic reasons. - Alternatively, construct the
UserBuilder
/GroupBuilder
fromAllUsers
/AllGroups
, and cause it to hold a mutable reference to itsAllUsers
/AllGroups
. Consuming the Builder then modifies theAll
.
- An alternative to a new function would be a builder pattern, probably using a new type (
-
RemoveUseredox_users::Result
and just useResult<T, failure::Error>
thiserror
to derive error for the library's error type, and provide more/better context for that error type. -
Implement Debug
forAllGroups
and fix the implementation forAllUsers
. It works right now, but it's not pretty.
Edited by SamwiseFilmore