随笔分类 -  rust

摘要:文件目录 toml 用的不是新版本都是稳定版本,新版本各种报错不兼容 [dependencies] tokio = { version = "1", features = ["full"] } prost = "0.12" tonic = { version = "0.10" } [build-de 阅读全文
posted @ 2025-12-24 09:44 朝阳1 阅读(9) 评论(0) 推荐(0)
摘要:安装protoc https://github.com/protocolbuffers/protobuf/releases toml prost = "0.14.1" tokio-stream = { version = "0.1", features = ["net"] } bytes = "1. 阅读全文
posted @ 2025-12-23 18:36 朝阳1 阅读(7) 评论(0) 推荐(0)
摘要:rbatis不需要安装mysql驱动,diesel这种orm需要额外安装mysql驱动,安了半天没安好,去他妈的把 toml rbs = { version = "4.6"} rbatis = { version = "4.6"} #drivers rbdc-mysql = { version = 阅读全文
posted @ 2025-09-16 16:55 朝阳1 阅读(44) 评论(0) 推荐(0)
摘要:toml log = "0.4" fast_log = { version = "1.7", features = ["lz4", "zip", "gzip"] } rs use fast_log::config::Config; use fast_log::plugin::file_split:: 阅读全文
posted @ 2025-09-16 16:50 朝阳1 阅读(22) 评论(0) 推荐(0)
摘要:diesel ={ version = "*", features = ["sqlite", "r2d2"]} diesel_derives = { version = "*", features = ["sqlite"] } lazy_static = "*" [build-dependencie 阅读全文
posted @ 2025-01-15 14:14 朝阳1 阅读(62) 评论(0) 推荐(0)
摘要:问题复现,假设我们有一个简单的 Point 结构体: struct Point { x: f64, y: f64, } impl Point { pub fn x_mut(&mut self) -> &mut f64 { &mut self.x } pub fn y_mut(&mut self) - 阅读全文
posted @ 2025-01-10 09:55 朝阳1 阅读(72) 评论(0) 推荐(0)
摘要:toml thiserror = "2.0" rs use std::io::Read; use std::{fs,io}; use thiserror::Error; #[derive(Debug,Error)] enum MyError{ #[error("")] IoError(#[from] 阅读全文
posted @ 2024-11-08 16:52 朝阳1 阅读(20) 评论(0) 推荐(0)
摘要:yaml # 检查配置文件变动的时间间隔 refresh_rate: 10 seconds # appender 负责将日志收集到控制台或文件, 可配置多个 appenders: stdout: # 控制台输出 kind: console encoder: # 格式可配置,具体格式详见: # htt 阅读全文
posted @ 2024-11-06 09:58 朝阳1 阅读(211) 评论(0) 推荐(0)
摘要:toml log = "0.4" log4rs = "1.3" rs use log::{error, info, warn, LevelFilter}; use log4rs::{ append::console::ConsoleAppender, config::{Appender, Root} 阅读全文
posted @ 2024-11-06 09:21 朝阳1 阅读(41) 评论(0) 推荐(0)
摘要:toml [package] name = "tklog" version = "0.1.0" edition = "2021" [dependencies] tklog = "0.2.6" tokio = "1.40" log = "0.4" actix-web = "4" backtrace = 阅读全文
posted @ 2024-11-05 16:01 朝阳1 阅读(97) 评论(0) 推荐(0)
摘要:git地址 https://github.com/donnie4w/tklog toml [dependencies] tklog = "0.2.6" tokio = "1.40" log = "0.4" 结合系统自带的日志库 use std::{thread, time::Duration}; u 阅读全文
posted @ 2024-11-05 14:52 朝阳1 阅读(83) 评论(0) 推荐(0)
摘要:cargo new book_api cd book_api toml [dependencies] actix-web = "4.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" rs use acti 阅读全文
posted @ 2024-11-04 11:11 朝阳1 阅读(40) 评论(0) 推荐(0)
摘要:单文件和多文件html的区别就是multiple toml [dependencies] rocket = "0.5.1" [package.metadata.rocket] config = "Rocket.toml" Rocket.toml 配置文件上传的大小限制 # Rocket.toml [ 阅读全文
posted @ 2024-10-30 11:16 朝阳1 阅读(63) 评论(0) 推荐(0)
摘要:php版本必须>=8.0 文档地址 https://docs.rs/ext-php-rs/0.12.0/ext_php_rs/index.html 创建lib项目 cargo new ext_php_rs --lib cd ext_php_rs 编辑toml [dependencies] ext-p 阅读全文
posted @ 2024-10-29 11:36 朝阳1 阅读(93) 评论(0) 推荐(0)
摘要:toml [dependencies] libc = "0.2.98" tokio = { version="1.8.1", features=["sync", "time", "rt-multi-thread","macros"] } tokio-tungstenite = "0.15.0" tu 阅读全文
posted @ 2024-10-29 09:18 朝阳1 阅读(298) 评论(0) 推荐(0)
摘要:toml actix-web = "4" redis = { version = "0.21.4", features = ["r2d2"] } r2d2 = "0.8.9" r2d2_redis = "0.14.0" uuid = { version = "0.8", features = ["v 阅读全文
posted @ 2024-10-25 17:11 朝阳1 阅读(78) 评论(0) 推荐(0)
摘要:toml jsonwebtoken = "9" rs use serde::{Deserialize, Serialize}; use chrono::Utc; use jsonwebtoken::errors::ErrorKind; use jsonwebtoken::{decode, encod 阅读全文
posted @ 2024-10-23 17:31 朝阳1 阅读(61) 评论(0) 推荐(0)
摘要:toml [dependencies] actix-web = "4" mysql = "25.0.0" chrono = "0.4" serde = { version = "1.0", features = ["derive"] } jsonwebtoken = "9" constants pu 阅读全文
posted @ 2024-10-22 11:23 朝阳1 阅读(244) 评论(0) 推荐(0)
摘要:toml [dependencies] mysql = "25.0.0" [[bin]] name = "mysql" path = "src/mysql.rs" mysql.rs use mysql::*; use mysql::prelude::*; #[derive(Debug)] struc 阅读全文
posted @ 2024-10-19 11:34 朝阳1 阅读(165) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2024-09-14 17:32 朝阳1 阅读(71) 评论(0) 推荐(0)