Closed jigar88 closed 3 years ago
You should add a return type to your function definition. Also not all paths return a value. Try this instead:
pub fn get_data_type(tag_value: Value) -> VariantTypeId {
match tag_value{
Value::Null => VariantTypeId::Empty,
Value::Bool(b) => VariantTypeId::Boolean,
Value::Number(n) => VariantTypeId::Int64,
_ => VariantTypeId::Empty
}
}
@schroeder- This is great help, thankyou :-)
I am making nodes based on json messages. In the messages I have various values like f64, i64, bool and String. How can I make it equivalent Variant for variable dat type. In python I used to do it easily with Variant class. I have snip of python code I used to convert opcua datatype from json.
I am trying to approach similarly but it gives an error for multiple type of return.
How can I similar result with this library?