MCPcopy Index your code
hub / github.com/better-rs/learn-rs

github.com/better-rs/learn-rs @v0.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.3 ↗ · + Follow
625 symbols 928 edges 260 files 82 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

learn-rs:

<a href="https://discord.com/invite/MnDA9pfWAW" target="_blank">
  <img src="https://img.shields.io/badge/Discord-GossipCoder-%237289DA.svg?logo=iscord&logoColor=white" alt="Discord">
</a>
<a href="https://discord.com/invite/MnDA9pfWAW" target="_blank">
  <img src="https://img.shields.io/discord/877031318272217179" alt="Discord">
</a>
<img src="https://visitor-badge.laobi.icu/badge?page_id=better-rs" alt="10000" />
  • ✅ 快速学习 rust.
  • ✅ 基于 rust workspace 的 monorepo 方式.

Related:

  • ✅ https://github.com/better-rs/annotated-rs
    • 注解 rust 知名项目源码
    • ⭐⭐⭐⭐⭐

目录:

Rust 学习:

子项目 说明 备注
rust-by-example Rust 官方练习代码 ⭐⭐⭐
basic Rust 语法练习
rs-leetcode 使用 Rust 刷题(leetcode) TODO
rs-try Rust 第三方lib 验证/调研 ⭐⭐
rs-ffi Rust + FFI ⭐⭐⭐
rs-tonic Rust + gRPC(Tonic) ⭐⭐⭐
rs-volo Rust + gRPC(Volo) ⭐⭐⭐
rs-sql Rust + sqlx 使用 ⭐⭐
xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxx

基于 Rust 写的脚本工具和业务系统:

子项目 说明 备注
rs-scripts rust cli 脚本工具: Binance 持币成本计算器 ⭐⭐⭐⭐⭐
rs-cms rust 小型 CMS 系统, 小型电商原型 ⭐⭐⭐
xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxx
xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxx

基于 Rust 写的小工具:

  • rs-scripts
    • 写的一些 rust 脚本工具
      • [x] ETH 链上交易查询
      • [x] Binance 交易所个人交易数据查询/K 线数据查询(支持 api key 方式下单/撤单)
      • [x] Binance 交易所币种持有成本计算器

快速安装小工具集:

# cd root directory:
cd learn-rs/

# install:
task scripts:install

  • 安装成功:

rs-scripts v0.1.0 (/better-rs/learn-rs/crates/rs-scripts):
    discord-bot
    rs-binance
    rs-eth-scanner
    rs-scripts
    rs-tui

  • 使用示例:
-> % rs-binance
binance 0.1.0
A binance CLI

USAGE:
    rs-binance <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    auth      auth: get user account data
    help      Print this message or the help of the given subcommand(s)
    market    market: get market data

1. 币安 - 持币平均成本计算器

效果:

源码位置:

功能说明:

  1. 目前支持: 币安交易所.
  2. 支持单个币种 + 多个交易对 合并计算.
    • 比如使用过 BUSD, UDST 购买 ETH, 需要合并计算 ETH 持有成本. (是支持的)
  3. 会自动计算: 买单平均成本, 卖单平均成本, 持币总数, 持币总成本.

使用方式:

  1. git clone 本项目
  2. 安装 rust, go-task(替代 Makefile 的命令行工具)
  3. copy .env.local 到 .env, 然后在 .env 添加 币安 api key(先在币安 web 版, 个人用户设置内申请).

#
# 项目根目录内执行: (Taskfile.yml 支持嵌套)
#
# 自动计算币安币种的持有成本, 比如 ETH/BTC/DOT
task scripts:run:binance

Requirements:

➤ rustc --version
rustc 1.65.0-nightly (17cbdfd07 2022-09-13)


➤ cargo version
cargo 1.65.0-nightly (646e9a0b9 2022-09-02)


➤ rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/dev/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin
nightly-2022-07-31-aarch64-apple-darwin
nightly-aarch64-apple-darwin (default)
1.61.0-aarch64-apple-darwin

active toolchain
----------------

nightly-aarch64-apple-darwin (default)
rustc 1.65.0-nightly (17cbdfd07 2022-09-13)

docs:

Extension points exported contracts — how you extend this code

DoubleDrop (Interface)
接口定义: [1 implementers]
crates/rs-101/rust-by-example/src/ch14_generics/ex03.rs
Greeter (Interface)
(no doc) [2 implementers]
crates/rs-tonic/src/pb/helloworld.rs
WindowExt (Interface)
(no doc) [1 implementers]
crates/rs-tauri-vue/src-tauri/src/main.rs
Contains (Interface)
(no doc) [2 implementers]
crates/rs-101/rust-by-example/src/ch14_generics/ex08.rs
GlobalComponents (Interface)
(no doc)
crates/rs-tauri-vue/components.d.ts
HasArea (Interface)
(no doc) [1 implementers]
crates/rs-101/rust-by-example/src/ch14_generics/ex04.rs
Window (Interface)
(no doc)
crates/rs-tauri-vue/src/main.ts
Red (Interface)
(no doc) [1 implementers]
crates/rs-101/rust-by-example/src/ch14_generics/ex04.rs

Core symbols most depended-on inside this repo

clone
called by 10
crates/rs-tonic/src/pb/helloworld.rs
wait
called by 7
crates/rs-tauri-vue/src/scrollWaiter.ts
inspect
called by 5
crates/rs-101/rust-by-example/src/ch03_custom_types/ex02.rs
connect
called by 3
crates/rs-tonic/src/pb/helloworld.rs
print_one
called by 3
crates/rs-101/rust-by-example/src/ch15_scope/ex04.rs
print
called by 3
crates/rs-101/rust-by-example/src/ch15_scope/ex04.rs
run
called by 3
crates/rs-101/rust-by-example/src/ch03_custom_types/ex02.rs
prepend
called by 3
crates/rs-101/rust-by-example/src/ch03_custom_types/ex02.rs

Shape

Function 318
Class 131
Method 117
Enum 48
Interface 11

Languages

Rust98%
TypeScript2%

Modules by API surface

crates/rs-101/rust-by-example/src/ch15_scope/ex04.rs33 symbols
crates/rs-scripts/src/core/binance/wallet.rs26 symbols
crates/rs-tonic/src/pb/helloworld.rs19 symbols
crates/rs-101/rust-by-example/src/ch14_generics/ex04.rs17 symbols
crates/rs-101/rust-by-example/src/ch03_custom_types/ex02.rs17 symbols
crates/rs-101/rust-by-example/src/ch09_fn/ex02.rs16 symbols
crates/rs-101/rust-by-example/src/ch16_trait/ex01.rs15 symbols
crates/rs-101/rust-by-example/src/ch09_fn/ex01.rs14 symbols
crates/rs-101/rust-by-example/src/ch01_hello/ex02.rs14 symbols
crates/rs-try/src/git/mod.rs12 symbols
crates/rs-scripts/src/core/binance/market.rs12 symbols
crates/rs-101/rust-by-example/src/ch14_generics/ex01.rs12 symbols

Datastores touched

(mysql)Database · 1 repos
cmsDatabase · 1 repos
diesel_demoDatabase · 1 repos

For agents

$ claude mcp add learn-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact