From 5dad9a134b1796c1f1feadcacdaad439701c6e7f Mon Sep 17 00:00:00 2001 From: Michael van Straten Date: Fri, 10 Apr 2026 15:53:15 +0200 Subject: [PATCH] sqlx-postgres: Make `PgNotification` struct clone --- sqlx-postgres/src/listener.rs | 1 + sqlx-postgres/src/message/notification.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlx-postgres/src/listener.rs b/sqlx-postgres/src/listener.rs index 9c439db854..1a84bd3d63 100644 --- a/sqlx-postgres/src/listener.rs +++ b/sqlx-postgres/src/listener.rs @@ -36,6 +36,7 @@ pub struct PgListener { } /// An asynchronous notification from Postgres. +#[derive(Clone)] pub struct PgNotification(Notification); impl PgListener { diff --git a/sqlx-postgres/src/message/notification.rs b/sqlx-postgres/src/message/notification.rs index 7bf029839c..8eafcc27f2 100644 --- a/sqlx-postgres/src/message/notification.rs +++ b/sqlx-postgres/src/message/notification.rs @@ -4,7 +4,7 @@ use crate::error::Error; use crate::io::BufExt; use crate::message::{BackendMessage, BackendMessageFormat}; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Notification { pub(crate) process_id: u32, pub(crate) channel: Bytes,