input_output 0.1.0

一个用于处理大数输入输出的 Rust 库
Documentation
  • Coverage
  • 55.56%
    5 out of 9 items documented0 out of 5 items with examples
  • Size
  • Source code size: 17.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.56 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rooct

input_output

Crates.io Documentation License

一个用于处理大数输入输出的 Rust 库。

功能特点

  • 支持大数运算
  • 高效的输入输出处理
  • 简单易用的 API

安装

将以下依赖添加到你的 Cargo.toml 文件中:

[dependencies]
input_output = "0.1.0"

使用示例

use input_output::*;

 let price = PairRate {
    token_pair: ("TOKEN_A".to_string(), "TOKEN_B".to_string()),
    rate: (10, 19), // 1 input_token = 2 output_token
    decimals: (24, 24),
};

// 输入1个token(24位精度)
let input_amount = 200_000_000_000_000_000_000_000_000u128; // 1 token with 24 decimals
let output = PairRate::calculate_output_amount(&price, input_amount).unwrap();
println!("Output amount: {}", output);

API 文档

详细的 API 文档可以在 docs.rs 查看。

最低支持的 Rust 版本(MSRV)

此库需要 Rust 1.56.0 或更高版本。

License

此项目采用 MIT/Apache-2.0 双重许可。

贡献

欢迎提交 Issues 和 Pull Requests!

更新日志

0.1.0 (2024-XX-XX)

  • 初始发布
  • 实现基本功能