![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Rust
Oliverlyn
学习是一个漫长的过程!长到从出生到死亡……
唯有对新知识、新技术保持激情才能长生不老!
展开
-
Fedora33 Uninstall CLion
1.Delete the installation directory.2.Remove the following directories:# ~/.config/JetBrains/<product><version># ~/.cache/JetBrains/<product><version># ~/.local/share/JetBrains/<product><version>###### Delete proced原创 2021-04-11 12:43:05 · 218 阅读 · 0 评论 -
rust-lldb调试Rust程序
rust-lldb如何调试带有选项的程序# rust-lldb -- target/debug/racon --root /opt/run/racon run 2333 --bundle /opt/mycontainer/很简单只需要在rust-lldb与程序之间添加 --原创 2021-01-04 19:31:11 · 1275 阅读 · 0 评论 -
Rust获取Vec中长度最短的字符串或最小数值(返回元素)
Rust获取数组中长度最短的字符串或最小数值题目0:给定一个数组[T; n],求最小值,其中T为i32类型fn get_min(vals: &[i32]) -> Option<&i32> { vals.iter().min_by_key(|x| x.abs())}fn main() { let a: [i32; 5] = [-3_i32, 0, 1, 5, -10]; println!("min: {:?}", a.iter().原创 2020-10-15 11:27:03 · 1545 阅读 · 0 评论 -
Debug Rust Program
How to Debug Rust ProgramExamplecloud-hypvisor vfio-deviceDebug Cmd with rust-gdbsudo rust-gdb --args ./cloud-hypervisor --kernel ./linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin --console off --serial tty --disk path=clear-31890-kvm.img -原创 2020-06-14 20:09:01 · 277 阅读 · 0 评论 -
Rust Standalone installers
Download gnu and MUSL# wget https://static.rust-lang.org/dist/rust-1.43.1-x86_64-unknown-linux-gnu.tar.gz# wget https://static.rust-lang.org/dist/rust-1.43.1-x86_64-unknown-linux-musl.tar.gzSetup# tar -xvf rust-1.43.1-x86_64-unknown-linux-musl.tar.gz原创 2020-05-23 22:05:24 · 1161 阅读 · 0 评论 -
Rust中如何在代码中引用sibling module
Rust代码中如何引用同级的其他module背景在一个rust源码工程中,需要在某一个crate中编写同一级别的module,crate结构大致如下:root@dragonfly:/home/RustProject/vmm# tree ..├── Cargo.lock├── Cargo.toml└── src ├── lib.rs ├── vmm_config │ ├── boot.rs │ ├── driver.rs │ ├── info.原创 2020-05-13 13:15:27 · 712 阅读 · 0 评论 -
APT and Snapd and Cargo and Git and go tools Config
Shell Env Set# git config --global http.proxy http:/proxy_ip:port# git config --global https.proxy https://proxy_ip:portGit Configure# cat ~/.gitconfig[http] proxy = http://proxy_ip:port[ht...原创 2020-02-14 20:34:08 · 289 阅读 · 0 评论 -
半小时学Rust
半小时学Rust有时为了加强编程语言的熟练程度,我们需要阅读很多相关文档。但如果不知道什么意思你如何去阅读呢?在本文中,我将介绍尽可能多的Rust Snippets,而不去过多关注某几个概念,而且会解释他们所包含关键字和符号的意义。准备好了吗?那开始吧!变量绑定let介绍了一种变量绑定的方式:let x; // declare "x"x = 42; // assign 42 to "...翻译 2020-02-12 15:44:20 · 608 阅读 · 0 评论 -
Rust必知的问题
// 由于Rust中没有Exception异常处理的语法,// Rust只有panic报错, 并且panic不允许被保护, 因为没有提供 try 这种语法.// Rust的异常处理是通过 Result 的 Ok 和 Err 成员来传递和包裹错误信息.// 然而错误信息的处理一般都是要通过match来对类型进行比较, 所以很多时候// 代码比较冗余, 通过?符号来简化Ok和Err的判断. ...原创 2019-07-05 09:02:08 · 1759 阅读 · 0 评论 -
Rust With VSCode
Rust With VSCodeRust Debug and Analysis with VSCodeEnvironments:[root@localhost ~]# uname -msrLinux 5.0.9-301.fc30.x86_64 x86_64[root@localhost ~]# cat /etc/os-releaseNAME=FedoraVERSION="30 (Wo...原创 2019-05-29 09:01:27 · 1564 阅读 · 0 评论 -
Hypervisors Implemented with Rust
Hypervisors Implemented with RustHypervisors(1) Firecracker: Firecracker(2) Crosvm: Crosvm(3) Clould-hypervisor: Cloud-hypervisorDifferencesTODOAnalysisTODO原创 2019-05-16 08:49:22 · 235 阅读 · 0 评论