From b59d0762d2a4a154f575ace197c85f5444b6adb7 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Mon, 1 Jan 2024 13:36:51 -0500 Subject: [PATCH] create constructors for VmcExtRvc --- src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index f9071a3..b03a8bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1139,7 +1139,7 @@ impl DeviceTranform { } #[derive(Debug)] -struct VmcExtRvc { +pub struct VmcExtRvc { enable: bool, port: u16, ip_addr: Option, @@ -1208,6 +1208,18 @@ impl VmcMessage for VmcExtRvc { } } +impl VmcExtRvc { + pub fn new(enable: bool, port: u16, ip_addr: Option) -> MsgNewResult { + Ok(Self { enable, port, ip_addr}) + } + pub fn new_vmc_message(enable: bool, port: u16, ip_addr: Option) -> TraitMsgNewResult { + match Self::new(enable, port, ip_addr) { + Ok(val) => Ok(Box::new(val)), + Err(val) => Err(val) + } + } +} + #[derive(Debug)] struct VmcExtLight { name: String,