Iterator implementation; General API
To be completely honest, iterators in rust still confound me, I can't wrap my head around them, so @goyox86 definitely knows better on this topic. I mainly opened this issue because I'd like to talk about API and how that relates to iterators, and how we want to manage that.
@goyox86 Do you see FromIterator
being an actual part of the users
api or just as a testing tool? Should we annotate it with #[cfg(test)]
?
In the Iterator department, I want to make sure that iterators are implemented in a way that makes sure that AllUsers
/AllGroups
always maintains ownership of their contents and never gives any other object ownership. With the way things are designed, I'd rather not be able to have multiple instances of the same User
The other thing I'd like to touch on are the trait impls of User
and Group
. It seems to me like how Display
and FromStr
are implemented are implementation details, and shouldn't part of the API. ToString
was not a good idea on my part either. Seems like all that should be internal API only. although it might be good to implement Display
at least for user debugging purposes.