Error handling in Rust

Error Handling in Rust Original link: https://blog.burntsushi.net/rust-error-handling/ Original author: Andrew Gallant Translation from: https://github.com/suhanyujie/article-transfer-rs/ translator: suhanyujie Translator blog: suhanyujie ps: the level is limited. Please correct the improper tUTF-8...

Posted by deltatango5 on Sat, 05 Feb 2022 19:11:22 +1030

Rust for Linux source code guide | Ref reference counting container original

Introduction In 2022, we are likely to see experimental Rust programming language support in the Linux kernel become mainstream. On the morning of December 6, 2021, an updated patch was issued to introduce the initial support and infrastructure for handling Rust in the kernel. This update incluUTF-8...

Posted by iainr on Fri, 11 Feb 2022 11:21:31 +1030

How to extend the WebAssembly of the server through the Host Function

Host Function is the main method to extend WebAssembly at present. This article will take you to open the new world of WebAssembly through two examples of Host Function! Author: Daruma docker, mainly responsible for WasmEdge-bindgen Development work. WebAssembly was originally developed from thUTF-8...

Posted by jwinn on Thu, 03 Mar 2022 18:21:55 +1030

Rust - Rocket framework - quick start

Roket official website The official document is english. I'm tired of reading it~ New project cargo new Project name --bin Cargo.toml [dependencies] rocket = "0.5.0-rc.1" Hello,world! src/main.rs #[macro_use] extern crate rocket; #[get("/")] / / routing attribute fn index() -> &'static str {//RUTF-8...

Posted by hash1 on Sun, 06 Mar 2022 17:16:10 +1030

Rust built-in trait: PartialEq and Eq

GitHub: https://github.com/storagezhang Emai: debugzhang@163.com Huawei cloud community: https://bbs.huaweicloud.com/blogs/250275 Eq and PartialEq are traits that allow you to define total and partial equality between values, respectively. Implementing them overloads the == and != operators. PaUTF-8...

Posted by kkobashi on Sun, 27 Mar 2022 07:45:39 +1030

Tutorial: SQL rust minimalism

brief introduction sqlx is a database access tool in t rust. It has the following characteristics: Asynchrony: native supports asynchrony, which can be better supported in occasions with high concurrency Check query at compile time: sqlx can check the execution sql and response value during carUTF-8...

Posted by LazyJones on Mon, 28 Mar 2022 15:13:47 +1030

Tokio, Rust, the way of asynchronous programming practice

origin In many programming languages, we are very happy to study the framework of asynchronous network programming used in this language, such as Gevent, asyncio, Nginx, OpenResty, Go, etc. in Python. At the beginning of this year, I began to contact Rust and was attracted by its features such UTF-8...

Posted by pomme on Thu, 31 Mar 2022 20:21:38 +1030

Rust study notes

Front work install curl https://sh.rustup.rs -sSf | sh Add to PATH: export PATH="$HOME/.cargo/bin:$PATH" to update rustup update file rustup doc Unofficial library documents cargo doc -p --open cargo crate: Cargo.toml: [dependicies] rand ="0.5.0" Version number usage Semantic version UTF-8...

Posted by laurton on Sun, 03 Apr 2022 04:12:56 +0930

Generic, trait, life cycle

1, Generics Generics are used to simplify and facilitate code reuse. It is similar to the template function and template class of C + +. Except for some differences in grammar, there is nothing special. generic structure struct Point { x: T, y: T, } fn main() { let integer = Point { x: 5, y:UTF-8...

Posted by keigowei on Fri, 08 Apr 2022 08:52:59 +0930

Intrigue with Rust · string

A three character stringOFFIs short for "Object File Format". What is the type of string in Rust language?&strIf C language is used, char * type can be used, such aschar *s = "OFF";The Rust language has a similar type & STR, for examplelet s: &str = "OFF";Or omit the type declaration of slet s UTF-8...

Posted by asy1mpo on Fri, 08 Apr 2022 10:12:41 +0930