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 Debug, Clone, and accessors on ConnectOptions #226

Merged

Conversation

aecsocket
Copy link
Contributor

Right now ConnectOptions is effectively opaque, but I want to inspect it after creation so I can log the URL that it connects to. The user of my crate creates and passes their own ConnectOptions, so I'm unable to read the URL before creation.

This PR derives Debug so that it can be debug printed, and adds url and additional_headers read-only accessor fields. It also derives Clone so that I can reuse the options for later.

IMO, these two fields should just be public. I don't see a reason to keep them private since this struct is just a data container. But for consistency with the rest of the API, and to allow extending ConnectOptions in the future without breaking existing code, I've just written accessors for the fields individually.

@BiagioFesta
Copy link
Owner

Thank you

@BiagioFesta BiagioFesta merged commit 71b6d4a into BiagioFesta:master Sep 23, 2024
8 checks passed
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.

2 participants