convert

Function convert 

Source
pub fn convert(
    value: Decimal,
    from: CurrencyUnit,
    to: CurrencyUnit,
) -> Result<Decimal, String>
Expand description

Convenience helper that fetches live rates directly.

This performs a blocking HTTP call using the default live provider. For deterministic or offline scenarios prefer convert_with_provider so you can supply your own rate source.