sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.39k stars 429 forks source link

[Tokio-Postgres] Error handling: Make tokio_postgres::error::Kind public #790 #1138

Open BaptisteRoseau opened 2 months ago

BaptisteRoseau commented 2 months ago

Feature request for https://github.com/sfackler/rust-postgres/issues/790

Make tokio_postgres::error::Kind public to enable users to match on it from a tokio_postgres::error::Error.

@sfackler I made two commit: one that returns a reference, the other that returns a cloned tokio_postgres::error::Kind instance. I was not sure whether it was not clonable on purpose or not.

Please see this comment for more details: https://github.com/sfackler/rust-postgres/issues/790#issuecomment-2095729043