Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Xaeroxe
Copy link

@Xaeroxe Xaeroxe commented Jan 21, 2021

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.

Copy link
Collaborator

@IniterWorker IniterWorker left a 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> {
Copy link
Collaborator

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

Copy link
Author

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.

@truehumandesign
Copy link
Owner

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.

Done!

@Xaeroxe
Copy link
Author

Xaeroxe commented Jan 18, 2022

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.

passcod added a commit to passcod/networkmanager that referenced this pull request Jan 28, 2024
Original from truehumandesign#1

Co-authored-by: Jacob Kiesel <jacob.kiesel@vivint.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants