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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow converting AnyConnectOptions to a specific ConnectOptions #1610

Merged
merged 1 commit into from Feb 17, 2022

Conversation

05storm26
Copy link
Contributor

No description provided.

@05storm26 05storm26 force-pushed the master branch 3 times, most recently from d37aed2 to 9665110 Compare January 5, 2022 18:04
@abonander
Copy link
Collaborator

This is a decent approach, but in addition I think we could stand to have, e.g.:

impl AnyConnectOptions {
    pub fn as_postgres(&self) -> Option<&PgConnectOptions> { ... }
    pub fn as_postgres_mut(&mut self) -> Option<&mut PgConnectOptions> { ... }
}

etc.

That could end up being a lot of code, of course, though I would personally use a macro to boil that down.

@05storm26
Copy link
Contributor Author

This is a decent approach, but in addition I think we could stand to have, e.g.:

impl AnyConnectOptions {
    pub fn as_postgres(&self) -> Option<&PgConnectOptions> { ... }
    pub fn as_postgres_mut(&mut self) -> Option<&mut PgConnectOptions> { ... }
}

etc.

That could end up being a lot of code, of course, though I would personally use a macro to boil that down.

This is also done. This requires a new dependency 'paste' which is a macro crate to create new identifiers from macros.

@abonander
Copy link
Collaborator

Yeah, we're fine with paste, it's a decent crate.

@05storm26
Copy link
Contributor Author

Can you merge this and do a release?

@05storm26
Copy link
Contributor Author

@abonander When can you merge this? Is this going to be in 0.6?

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.

None yet

2 participants