From 85f4c6088c8c0e56ccd83e8a9a23d50b8106d53a Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Tue, 20 Feb 2024 17:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E7=9A=84=E8=A6=81=E6=9D=A5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/src/py/class.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ica-rs/src/py/class.rs b/ica-rs/src/py/class.rs index 87b6779..3464455 100644 --- a/ica-rs/src/py/class.rs +++ b/ica-rs/src/py/class.rs @@ -1,5 +1,6 @@ use pyo3::prelude::*; +use crate::data_struct::messages::{NewMessage, ReplyMessage, SendMessage}; use crate::ClientStatus; #[pyclass] @@ -104,3 +105,39 @@ impl IcaStatusPy { Self {} } } + +#[pyclass] +#[pyo3(name = "NewMessage")] +pub struct NewMessagePy { + pub msg: NewMessage, +} + +impl NewMessagePy { + pub fn new(msg: &NewMessage) -> Self { + Self { msg: msg.clone() } + } +} + +#[pyclass] +#[pyo3(name = "ReplyMessage")] +pub struct ReplyMessagePy { + pub msg: ReplyMessage, +} + +impl ReplyMessagePy { + pub fn new(msg: ReplyMessage) -> Self { + Self { msg } + } +} + +#[pyclass] +#[pyo3(name = "SendMessage")] +pub struct SendMessagePy { + pub msg: SendMessage, +} + +impl SendMessagePy { + pub fn new(msg: SendMessage) -> Self { + Self { msg } + } +}