From f24d788950d172c85d700866eb20992e8010e539 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Mon, 1 Jan 2024 14:01:06 -0500 Subject: [PATCH] create constructors for VmcExtSetPeriod --- src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index b5df94c..d699b10 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1725,7 +1725,7 @@ impl VmcThru { } #[derive(Debug)] -struct VmcExtSetPeriod { +pub struct VmcExtSetPeriod { status: i32, root: i32, bone: i32, @@ -1786,6 +1786,18 @@ impl VmcMessage for VmcExtSetPeriod { } } +impl VmcExtSetPeriod { + pub fn new(status: i32, root: i32, bone: i32, blendshape: i32, camera: i32, devices: i32) ->MsgNewResult { + Ok(Self { status, root, bone, blendshape, camera, devices}) + } + pub fn new_vmc_message(status: i32, root: i32, bone: i32, blendshape: i32, camera: i32, devices: i32) ->TraitMsgNewResult { + match Self::new(status, root, bone, blendshape, camera, devices) { + Ok(val) => Ok(Box::new(val)), + Err(val) => Err(val), + } + } +} + #[derive(Debug)] struct VmcExtSetEye { enable: i32,