| Crates.io | kr |
| lib.rs | kr |
| version | 0.6.1 |
| created_at | 2025-03-13 11:47:40.413033+00 |
| updated_at | 2025-11-10 02:12:34.372392+00 |
| description | The Rust Development Toolkit |
| homepage | |
| repository | https://github.com/noble-gase/kr |
| max_upload_size | |
| id | 1590773 |
| size | 42,858 |
[氪-Kr] Rust开发工具包
cargo add kr --features macros
bb8 的Redis异步Manager⚠️ aes 相关功能依赖 openssl
#[derive(Model)]
#[partial(UserLite !(email, phone))] // 排除字段
#[partial(UserBrief (id, name), derive(Copy, Debug))] // 包含字段
pub struct User {
pub id: i64,
#[sqlx(rename = "username")]
pub name: String,
pub email: String,
pub phone: String,
pub created_at: String,
pub updated_at: String,
}
#[derive(sqlx::FromRow)]
pub struct UserLite {
pub id: i64,
#[sqlx(rename = "username")]
pub name: String,
pub created_at: String,
pub updated_at: String,
}
#[derive(sqlx::FromRow, Copy, Debug)]
pub struct UserBrief {
pub id: i64,
#[sqlx(rename = "username")]
pub name: String,
}
👉 具体使用可以参考 rnx
Enjoy 😊