create constructors for VmcExtRvc
This commit is contained in:
parent
b027035aba
commit
b59d0762d2
14
src/lib.rs
14
src/lib.rs
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user