Closed ghost closed 5 years ago
Sorry for the late response.
FloatValue
implements From<f32>
so you can just call FloatValue::from(f32)
to get a FloatValue
from an f32
.
If you just want to convert your f32
into a Value
object, you can also use the as_val!
macro.
Hi!
I'm trying to use
FloatValue
and it looks weird that it hasu32
andu64
in the enum declaration instead off32
andf64
correspondingly:https://github.com/aerospike/aerospike-client-rust/blob/430780ae408a1e224b9ad3a232db36d61099ad3a/src/value.rs#L35-L42
So in order to use for example
f32
value it is necessary to invokemem::transmute_copy::<u32, f32>
.