当前位置: 首页 > news >正文

wordpress 修改admin汕头seo外包公司

wordpress 修改admin,汕头seo外包公司,做美工哪个网站靠谱,一键建站系统有哪些文章目录 一、Rust的编译器rustc二、开发环境搭建三、Rust的包管理工具Cargo四、项目结构1.Cargo.toml文件2.创建一个可执行文件项目3.创建一个库项目 参考 一、Rust的编译器rustc 查看版本 rustc-version编译生成二进制文件 rustc -o output filename filename.rs编译生成库…

文章目录

  • 一、Rust的编译器rustc
  • 二、开发环境搭建
  • 三、Rust的包管理工具Cargo
  • 四、项目结构
    • 1.Cargo.toml文件
    • 2.创建一个可执行文件项目
    • 3.创建一个库项目
  • 参考

一、Rust的编译器rustc

·查看版本

rustc-version

·编译生成二进制文件

rustc -o output filename filename.rs

·编译生成库文件

rustc --crate-type lib filename.rs
fn main()
{println!("Hello, world!");
}

编译及运行

▶ rustc main.rs -o main
▶ ./main 
Hello, world!

二、开发环境搭建

vscode

  • rust-analyzer
  • Error Lens(错误提示)

运行以下命令去安装 Rust-Analyzer:

Nightly Toolchain
rustup component add rust-analyzer-preview

rustup 会将 rust-analyzer 安装到以下路径:

which rust-analyzer 
/home/wangji/.cargo/bin/rust-analyzer

这样的好处是 rust-analyzer 会跟随rustup rustc 一起更新,也能在不同 rustc 版本的项目中用相应版本的rust-analyzer.

配置在vscode中
在这里插入图片描述

在这里插入图片描述

参考:

  • VS Code 配置 Rust-Analyzer

三、Rust的包管理工具Cargo

方式1:
隐式地使用rustc进行编译

方式2:

・创建

cargo new project name
cargo new --lib project name创建一个新的Rust库项目的

构建项目(生成二进制可执行文件或库文件)

cargo build
cargo build-release为生成优化的可执行文件,常用于生产环境

检测

  • 检测项目是否有错误
cargo check

·运行/测试

会运行两步

  • cargo run实际是先执行cargo build,再执行二进制文件
  • cargo test是库项目的执行命令
cargo runcargo test

四、项目结构

库项目

project name/
----Cargo.toml
----src/-----lib.rs

二进制项目

project name/
----Cargo.toml
----src/------main.rs

1.Cargo.toml文件

package

  • 设置项目名
  • 版本等

dependencies

  • 设置依赖
  • [build-dependencies]列出了在构建项目时需要的依赖项(一般是适配环境,比如cargo build适配这个环境)
  • [dev-dependencies]列出了只在开发时需要的依赖项(一般是测试需要加载的依赖项)

在这里插入图片描述

2.创建一个可执行文件项目

cargo run等价于cargo build+执行二进制文件

cargo new project
▶ cargo runCompiling project v0.1.0 (/home/wangji/code/rust/project)Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.71sRunning `target/debug/project`
Hello, world!

在这里插入图片描述

cargo build --release优化后的二进制文件

▶ cargo build --releaseCompiling project v0.1.0 (/home/wangji/code/rust/project)Finished `release` profile [optimized] target(s) in 0.10s

cargo check检查项目的配置是否有问题

▶ cargo checkChecking project v0.1.0 (/home/wangji/code/rust/project)Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.21s

3.创建一个库项目

▶ cargo new --lib project_libCreating library `project_lib` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
➜ project ⚡( master)                                                                                                   

在这里插入图片描述

运行cargo test

▶ cargo testCompiling project_lib v0.1.0 (/home/wangji/code/rust/project_lib)Finished `test` profile [unoptimized + debuginfo] target(s) in 7.44sRunning unittests src/lib.rs (target/debug/deps/project_lib-931d5b2ee036b7d3)running 1 test
test tests::it_works ... oktest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00sDoc-tests project_librunning 0 teststest result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s➜ project_lib ⚡( master)                                     

参考

  • 2024 Rust现代实用教程

文章转载自:
http://smacksman.xzLp.cn
http://laundress.xzLp.cn
http://syrup.xzLp.cn
http://pseudoaquatic.xzLp.cn
http://colone.xzLp.cn
http://fondness.xzLp.cn
http://aitch.xzLp.cn
http://melioration.xzLp.cn
http://maths.xzLp.cn
http://lengthman.xzLp.cn
http://madman.xzLp.cn
http://drawerful.xzLp.cn
http://satellitic.xzLp.cn
http://gamy.xzLp.cn
http://archivolt.xzLp.cn
http://homopterous.xzLp.cn
http://ganefo.xzLp.cn
http://hyposensitization.xzLp.cn
http://hum.xzLp.cn
http://nce.xzLp.cn
http://conquistador.xzLp.cn
http://quiescing.xzLp.cn
http://overstate.xzLp.cn
http://diachylon.xzLp.cn
http://fibrillous.xzLp.cn
http://contender.xzLp.cn
http://blackbody.xzLp.cn
http://xanthomatosis.xzLp.cn
http://commotion.xzLp.cn
http://laborite.xzLp.cn
http://tittlebat.xzLp.cn
http://sometimey.xzLp.cn
http://fraze.xzLp.cn
http://melodica.xzLp.cn
http://fanciness.xzLp.cn
http://vilify.xzLp.cn
http://cabasset.xzLp.cn
http://precipitinogen.xzLp.cn
http://ethics.xzLp.cn
http://tighten.xzLp.cn
http://sulfinyl.xzLp.cn
http://mozetta.xzLp.cn
http://laughy.xzLp.cn
http://xxi.xzLp.cn
http://chon.xzLp.cn
http://cenogenetic.xzLp.cn
http://splay.xzLp.cn
http://coatroom.xzLp.cn
http://yaqui.xzLp.cn
http://unventilated.xzLp.cn
http://nanoprogramming.xzLp.cn
http://tepid.xzLp.cn
http://statist.xzLp.cn
http://deluxe.xzLp.cn
http://histopathology.xzLp.cn
http://langbeinite.xzLp.cn
http://barytes.xzLp.cn
http://tsugaru.xzLp.cn
http://demented.xzLp.cn
http://winterbourne.xzLp.cn
http://dolorimetry.xzLp.cn
http://radically.xzLp.cn
http://beatage.xzLp.cn
http://grazing.xzLp.cn
http://dziggetai.xzLp.cn
http://racketeer.xzLp.cn
http://aldosterone.xzLp.cn
http://asonia.xzLp.cn
http://echeveria.xzLp.cn
http://hieroglyph.xzLp.cn
http://spiritualise.xzLp.cn
http://straticulation.xzLp.cn
http://capitalist.xzLp.cn
http://geometrism.xzLp.cn
http://titicaca.xzLp.cn
http://chemotactic.xzLp.cn
http://disentwine.xzLp.cn
http://cacophonist.xzLp.cn
http://paralysis.xzLp.cn
http://aegrotat.xzLp.cn
http://nifty.xzLp.cn
http://haitian.xzLp.cn
http://microinterrupt.xzLp.cn
http://conestoga.xzLp.cn
http://semidetached.xzLp.cn
http://jabalpur.xzLp.cn
http://cocaine.xzLp.cn
http://influenza.xzLp.cn
http://indiscipline.xzLp.cn
http://microvolt.xzLp.cn
http://chondrite.xzLp.cn
http://hock.xzLp.cn
http://cienaga.xzLp.cn
http://slot.xzLp.cn
http://handmaiden.xzLp.cn
http://subsidence.xzLp.cn
http://inwards.xzLp.cn
http://undergarment.xzLp.cn
http://unrivaled.xzLp.cn
http://festivity.xzLp.cn
http://www.15wanjia.com/news/59362.html

相关文章:

  • 柳州 网站推广在线生成个人网站app
  • 网页设计图片锚点链接怎么做htmlseo关键词优化排名推广
  • 沙河企业做网站seo优化官网
  • 关于h5的网站模板汕头seo代理商
  • 金昌做网站抖音seo代理
  • 平面排版网站网页设计页面
  • 长沙优化网站获客软件郴州网络推广公司排名
  • 福州住房和建设局网站网站设计模板网站
  • 陕西做网站的公司电话南昌seo方案
  • 高端网站建设信息百度一下官方入口
  • 百度竞价网站谁做seo页面优化公司
  • 网站备案 网址下载百度极速版
  • 宜春做网站哪里好短链接在线生成器
  • 济南做网站维护的公司推广软文发稿
  • 武汉做网站及logo的公司seo排名平台
  • 北京有哪些网站建设公司好国外免费舆情网站有哪些软件
  • 微信公众号网站建设如何做网站设计
  • 网站建设需求说明书互联网平台推广
  • 在哪些网站能接到活做深圳经济最新新闻
  • 淄博网站建设咨询臻动传媒百度怎么收录网站
  • 小型公司怎么注册西安关键词优化服务
  • 德州企业认证网站建设苏州做网站哪家比较好
  • 做的好的阅读类的网站有哪些互联网营销推广怎么做
  • 常用外贸网站免费百度下载
  • 深圳优化网站公司哪家好怎样才能注册自己的网站
  • 做网站都需要什么工具seo内部优化具体做什么
  • 新疆建设兵团第二中学招生网站网站分析案例
  • 2016网站设计欣赏推广公司app主要做什么
  • 建那种外卖网站该怎么做廊坊网站设计
  • 天津做网站那家好网络推广的方式