currency.rs

Overview

The currency.rs file defines the OtherCurrency data structure, which represents a currency amount with optional numeric and string representations. It provides functionality for formatting the currency value into different big integer formats asynchronously. This file leverages the async_graphql framework to expose OtherCurrency as a GraphQL object with complex fields, facilitating its use in GraphQL APIs.

Data Structures and Types

OtherCurrency

OtherCurrency is a GraphQL object that encapsulates a currency amount in two forms:

The struct is annotated with:

Methods

value(&self, format: Option<BigIntFormat>) -> Option<String>

Implementation Details

Interaction with Other Modules

Diagram: Class Structure of OtherCurrency

classDiagram
class OtherCurrency {
+currency: Option<f64>
-value: Option<String>
+value(format: Option<BigIntFormat>): Option<String> (async)
}

This diagram illustrates the OtherCurrency struct's fields and its asynchronous method for retrieving formatted currency values. The value field is private to GraphQL and accessed through the value() method.