From 0df24c1f9172c8fd7fde2d432fb269ac8ccf3824 Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:16:02 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=E2=9C=A8=20alert=20trait?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/alert.rs | 3 +++ judge_control_app/src/lib.rs | 1 + judge_control_app/src/main.rs | 1 + 3 files changed, 5 insertions(+) create mode 100644 judge_control_app/src/alert.rs diff --git a/judge_control_app/src/alert.rs b/judge_control_app/src/alert.rs new file mode 100644 index 0000000..b5796d8 --- /dev/null +++ b/judge_control_app/src/alert.rs @@ -0,0 +1,3 @@ +pub trait Alert { + fn send_alert(&self, message: T); +} diff --git a/judge_control_app/src/lib.rs b/judge_control_app/src/lib.rs index 1e05942..853a493 100644 --- a/judge_control_app/src/lib.rs +++ b/judge_control_app/src/lib.rs @@ -5,3 +5,4 @@ pub mod remote_exec; pub mod spmc_oneshot; pub mod submission_logic; pub mod text_resource_repository; +pub mod alert; diff --git a/judge_control_app/src/main.rs b/judge_control_app/src/main.rs index 6cb8742..24aafe3 100644 --- a/judge_control_app/src/main.rs +++ b/judge_control_app/src/main.rs @@ -5,6 +5,7 @@ mod remote_exec; mod spmc_oneshot; mod submission_logic; mod text_resource_repository; +mod alert; fn main() { println!("Hello, world!"); From fe4df1ee557aaeece83acfd4b3405dc043a3e814 Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:21:00 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=8E=A8=20cargo=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge_control_app/src/lib.rs b/judge_control_app/src/lib.rs index 853a493..741f386 100644 --- a/judge_control_app/src/lib.rs +++ b/judge_control_app/src/lib.rs @@ -1,3 +1,4 @@ +pub mod alert; pub mod container; pub mod custom_rc; pub mod models; @@ -5,4 +6,3 @@ pub mod remote_exec; pub mod spmc_oneshot; pub mod submission_logic; pub mod text_resource_repository; -pub mod alert; From 5a8cac519756ec298fe36c76bb7190211409481b Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:21:12 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=8E=A8=20cargo=20fmt2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge_control_app/src/main.rs b/judge_control_app/src/main.rs index 24aafe3..a6e6816 100644 --- a/judge_control_app/src/main.rs +++ b/judge_control_app/src/main.rs @@ -1,3 +1,4 @@ +mod alert; mod container; mod custom_rc; mod models; @@ -5,7 +6,6 @@ mod remote_exec; mod spmc_oneshot; mod submission_logic; mod text_resource_repository; -mod alert; fn main() { println!("Hello, world!"); From 5485e373b3f5fb9dd7eddf6077765d00229374a5 Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:34:50 +0900 Subject: [PATCH 4/8] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20send=20alert=20is=20as?= =?UTF-8?q?ync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/alert.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge_control_app/src/alert.rs b/judge_control_app/src/alert.rs index b5796d8..cb73d4c 100644 --- a/judge_control_app/src/alert.rs +++ b/judge_control_app/src/alert.rs @@ -1,3 +1,3 @@ pub trait Alert { - fn send_alert(&self, message: T); + async fn send_alert(&self, message: T); } From f2861b05c77a6ef3c8b58ab57e6fdf562ddf451b Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:42:26 +0900 Subject: [PATCH 5/8] =?UTF-8?q?=E2=9C=A8=20body=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/alert.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/judge_control_app/src/alert.rs b/judge_control_app/src/alert.rs index cb73d4c..b3c374f 100644 --- a/judge_control_app/src/alert.rs +++ b/judge_control_app/src/alert.rs @@ -1,3 +1,7 @@ -pub trait Alert { - async fn send_alert(&self, message: T); +pub trait Alert { + async fn send_alert( + &self, + message: MessageType, + body: BodyType, + ); } From b8dc91b6ded6522142bd500a5496c20da3098ebc Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:52:25 +0900 Subject: [PATCH 6/8] =?UTF-8?q?=E2=9C=A8=20structural=20alert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/alert.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/judge_control_app/src/alert.rs b/judge_control_app/src/alert.rs index b3c374f..e3ed533 100644 --- a/judge_control_app/src/alert.rs +++ b/judge_control_app/src/alert.rs @@ -1,7 +1,13 @@ -pub trait Alert { +pub trait Alert { async fn send_alert( &self, message: MessageType, - body: BodyType, ); } + +pub trait StructuralAlert { + async fn send_alert( + &self, + body: &BodyType, + ); +} \ No newline at end of file From 730f849c5c684d985460abab0a934afe89ec9384 Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:53:31 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20pass=20message=20ref?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/alert.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/judge_control_app/src/alert.rs b/judge_control_app/src/alert.rs index e3ed533..062607d 100644 --- a/judge_control_app/src/alert.rs +++ b/judge_control_app/src/alert.rs @@ -1,7 +1,7 @@ pub trait Alert { - async fn send_alert( + async fn send_alert( &self, - message: MessageType, + message: &MessageType, ); } From 79c1b0fa94c05c46bb51d5840ae423b01d798c13 Mon Sep 17 00:00:00 2001 From: comavius Date: Mon, 23 Dec 2024 16:55:41 +0900 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=8E=A8=20cargo=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge_control_app/src/alert.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/judge_control_app/src/alert.rs b/judge_control_app/src/alert.rs index 062607d..f9426f4 100644 --- a/judge_control_app/src/alert.rs +++ b/judge_control_app/src/alert.rs @@ -1,13 +1,7 @@ pub trait Alert { - async fn send_alert( - &self, - message: &MessageType, - ); + async fn send_alert(&self, message: &MessageType); } pub trait StructuralAlert { - async fn send_alert( - &self, - body: &BodyType, - ); -} \ No newline at end of file + async fn send_alert(&self, body: &BodyType); +}