rust
rust语法基础
落子无悔!
念念不忘,必有回响.不积小流,无以成江海.
展开
-
rust 模块/文件/project
文章目录一. project1.1 利用cargo创建project1.2 引入包依赖 例: 使用rand包生成随机数二. 跨文件的使用模块 一. project 1.1 利用cargo创建project 利用cargo管理rust的project是非常方便的 $ cargo new test1 # 创建工程名为test1的project Created binary (application) `test1` package $ cd test1/ # 进入到工程中 test1$ tree原创 2020-12-29 18:30:20 · 2211 阅读 · 0 评论 -
rust基础语法知识
文章目录一. slice二. 引用& /借用&mut /悬垂引用 return &s三. 所有权四. 结构体 struct /impl五. 枚举六. option类型七. vector类型 一. slice fn slice_test() { let s = String::from("hello world"); // let h = &s[0..5]; // let h = &s[0..=4]; // 0开始占4个位 // let h = &s[.原创 2020-12-29 16:23:20 · 2252 阅读 · 0 评论 -
rust环境配置
说明 最近因为需要对rust进行漏洞检测工作, 因此需要先学习rust的基本语法和配置运行环境 这里参考菜鸟教程配置rust编程编译环境 工具: win10子系统Ubuntu VScode 安装插件 rust和native debug还有remote-WSL rust编译工具 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh Ubuntu下执行安装选择1 rustc -V # 查看版本 安装gdb, C/C++ debug工具原创 2020-12-07 17:19:03 · 3087 阅读 · 0 评论
分享