-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a settings object, along with a couple methods for it #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the first vector-based approach from @he4d is the current way to go. If we want to change of approach to be iterator-based, we should consider refactoring all vector-based implementation.
Note to @he4d, Clippy report a lot of error remaining of precedent commits. We should clean up the Clippy warning in the current code to prevent false alarms of the CI.
} | ||
} | ||
|
||
pub fn list_connections(&self) -> Result<impl Iterator<Item = Connection>, Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Xaeroxe,
It seems that the main approach is a vector in other parts of the code. In this case, Could you tell me more about the usage of an impl Iterator
VS a vector?
B. r
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! An Iterator is a structure which describes how to obtain the data contained within. Whereas a Vec is a heap allocated collection containing the data. An Iterator can be turned into a Vec by collecting it, and a Vec can be iterated in several ways. The Iterator can be interacted with without requiring a heap allocation, and can be combined with other Iterators. In the end the two approaches are very similar but an Iterator might be more efficient.
Done! |
I'm gonna be up front about something: I'm not willing to do further work on this PR. It's being offered as-is. If I get a request for change I will probably close the PR. I've left the systemd sphere in my professional life and don't want to setup the environment necessary to work on this. No hard feelings if you close this PR. |
Original from zibebe#1 Co-authored-by: Jacob Kiesel <[email protected]>
Proposed Changes
Adds a Settings object along with a couple methods for it.
This was originally going to be more comprehensive but my need for these bindings has vanished. However I figured someone else might still find the work I did accomplish to be useful.