converter method
- MeasureUnit from,
- MeasureUnit to
Creates a new UnitsConverter from the input and output MeasureUnits.
Returns nothing if the conversion between the two units is not possible.
For example, conversion between meter
and second
is not possible.
See the Rust documentation for converter
for more information.
Implementation
UnitsConverter? converter(MeasureUnit from, MeasureUnit to) {
final result = _icu4x_UnitsConverterFactory_converter_mv1(_ffi, from._ffi, to._ffi);
return result.address == 0 ? null : UnitsConverter._fromFfi(result, []);
}