Rust | tags

Rust Error Handling Notes 23-07-22

初学 rust 的时候,上手写代码总是遇到很多不一样的 rust 的Result类型,不同 crate 中的函数返回的Result<T, E>的E都不一样,刚开始都是unwrap或者expect来处理。如果使用try!或者?的话总是编译不通过,还是对 Error 转换和处理不熟练。 […] 在一个方法中,调用不同的函数会返回不同的 error 类型,需要你将这些类型转换成 …

Tour of Rusts Standard Library Traits[翻译] 21-04-11

关于 rust trait 非常好的介绍,比 rust book 详细,系统。 […] Have you ever wondered what’s the difference between: […] Or ever asked yourself the questions: […] Well then this is the article …

Associated Type in Rust 20-09-20

Associated Type and generic diff in rust […] a type Foo = Bar outside is just type alias. most used in generic type. […] like: type Thunk = Box<dyn Fn() + Send + 'static>; …

基于 MDX 的 web 词典 20-07-01

Mdict 项目是一个糅合了 MDX 词典、ES 例句搜索和 AI 模型翻译的多源搜索功能 Web 词典。特别适合部署在内网中学习使用或者给孩子学习使用。 python 版本增加了一个机器学习模型翻译.rust 版本也有模型,但是还没来得及加。 […] mdict-py 源码 […] Mdict 项目是一个糅合了 MDX 词典、ES 例句搜索和 AI 模型翻译的多源搜索 …

Rust Ownerships Lifetimes 教程 20-02-22

some notes on rust ownership,reference,string and &str, and lifetimes […] //heap and stack: stack is store data that known,fixed size. //memory manager keeping track of what parts of code …

SpringBoot & Rust 应用的 Dockerfile 优化 20-02-03

记录 spring boot 和 rust 项目的 Dockerfile 的最佳实践。 […] spring.io 提供了一个 boot 应用的Dockerfile指导。 不过有个问题,这个 Dockerfile 使用的 maven 是项目源码里面 copy 过去的。在一般企业项目中这么做显然不规范,直接使用 maven 基础镜像更合理。 […] Dockerfile …

Rust Packages Crates Mod Notes 20-01-12

初学 rust 对于项目的 package 和 crate 的关系,module 和文件的关系有点理不清。做了一点笔记。 […] A Cargo.toml is a package. and must have a package name, defined in [package] table: […] [package] name = …