create constructors for VmcExtRvc

This commit is contained in:
Cassandra de la Cruz-Munoz 2024-01-01 13:36:51 -05:00
parent b027035aba
commit b59d0762d2
Signed by: cassdlcm
GPG Key ID: BFEBACEA812DDA70

View File

@ -1139,7 +1139,7 @@ impl DeviceTranform {
}
#[derive(Debug)]
struct VmcExtRvc {
pub struct VmcExtRvc {
enable: bool,
port: u16,
ip_addr: Option<String>,
@ -1208,6 +1208,18 @@ impl VmcMessage for VmcExtRvc {
}
}
impl VmcExtRvc {
pub fn new(enable: bool, port: u16, ip_addr: Option<String>) -> MsgNewResult<Self> {
Ok(Self { enable, port, ip_addr})
}
pub fn new_vmc_message(enable: bool, port: u16, ip_addr: Option<String>) -> TraitMsgNewResult {
match Self::new(enable, port, ip_addr) {
Ok(val) => Ok(Box::new(val)),
Err(val) => Err(val)
}
}
}
#[derive(Debug)]
struct VmcExtLight {
name: String,