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

怎样做网站的关键字搜索功能网站seo谷歌

怎样做网站的关键字搜索功能,网站seo谷歌,python 做网站教程,济南环保局官方网站本文为第0篇 专栏简介 本专栏是优质Rust技术专栏,推荐精通一门技术栈的蟹友,不建议基础的同学(无基础学Rust也是牛人[手动捂脸]) 感谢Rust圣经开源社区的同学,为后来者提供了非常优秀的Rust学习资源 本文使用&…

本文为第0篇

专栏简介

本专栏是优质Rust技术专栏,推荐精通一门技术栈的蟹友,不建议基础的同学(无基础学Rust也是牛人[手动捂脸])

感谢Rust圣经开源社区的同学,为后来者提供了非常优秀的Rust学习资源

本文使用:

  • 操作系统macOS Sonoma 14 / Apple M1
  • 编译器:Rustc & Cargo

感谢一路相伴的朋友们,感谢你们的支持 ^ _ ^

Rust教程:How to Rust-在开始之前到Hello World


目录

专栏简介

更新记录

前言

锈起来

安装C语言编译器

Cargo

Hello World

运行项目

Cargo check 

Cargo.lock and Cargo.toml

结语

本文参考文献


更新记录

2024.03.09 发布文章


前言

带你入门Rust,咋搞Rust?Cargo是什么?写个Hello World?


锈起来

rustup是Rust的安装工具,也是它的版本管理工具,所以建议使用rustup来安装Rust(下述方式不适用于Windows,但网络上有很多成熟的Windows安装方案,你可以参考👉这个)

如果你不想用rustup来安装,那你可以了解一下Rust的其他安装方式

打开终端输入指令

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

它将下载一个脚本,之后就会开始安装rustup工具,此工具将安装Rust的最新稳定版本

后面会有一些选项,按需选择即可

如果你安装成功了,则会提示:

Rust is installed now. Great!

安装C语言编译器

Rust在几乎所有环境都可以无需安装任何依赖直接运行。但是,Rust会依赖libc和链接器linker。所以如果遇到了提示链接器无法执行的错误,你需要再手动安装一个C编译器。当然我相信macOS的开发者们一定有homebrew,那就一定被苹果硬塞了一个Clang,所以该部分就不赘述了

Cargo

Cargo是Rust中的包管理工具,包管理工具的重点是:任何人拿到了了你的源码,就能运行起来。不只各位是否同时用过Node.js和C++的老版本,在编写C++程序的时候无比希望拥有一个NPM一样包管理工具,但确实没有

它不像老版本的Go,所有的包都在GitHub,导致了所有的项目都依赖一套代码,用起来简直是一言难尽(go转rust过来的同学要泪奔了)

Rust采用了多个语言的包管理优点,祭出恐怖如斯的cargo,很合我胃口👍👍👍

总而言之,cargo提供了一系列的工具,从项目的建立、构建到测试、运行到部署。同时,与rustc结合,主打一个全套,可以说用了就离不开了

Hello World

上文我们了解了Cargo,但我们无需再手动安装,之前安装 Rust 的时候,就已经一并安装了

那就开始new起来吧

cargo new hello_world
cd hello_world

面的命令使用cargo new建一个项目,项目名是hello_world,该项目的结构和配置文件都是由cargo生成,也就是着我们的项目被cargo所管理

项目结构如下 

.
├── .git
├── .gitignore
├── Cargo.toml
└── src└── main.rs

 连Git都整好了,他真的我哭死

运行项目

运行项目可以分成两种

  1. cargo run
  2. 手动编译

先来第一种方式,成功 

$ cargo runCompiling hello_world v0.1.0 (/Users/bayi/code/rust/blog/hello_world)Finished dev [unoptimized + debuginfo] target(s) in 0.19sRunning `target/debug/hello_world`
Hello, world!

 第二种手动编译,也成功

$ cargo buildCompiling hello_world v0.1.0 (/Users/bayi/code/rust/blog/hello_world)Finished dev [unoptimized + debuginfo] target(s) in 0.20s$ ./target/debug/hello_world
Hello, world!

你们可能会发现,里面有个debug字段

在debug模式下,编译速度变快,但运行速度变慢,能不能更完美呢?其实改用release模式即可

可以用cargo run --release或者cargo build --release

$ cargo build --releaseCompiling hello_world v0.1.0 (/Users/bayi/code/rust/blog/hello_world)Finished release [optimized] target(s) in 0.57s$ ./target/release/hello_world
Hello, world!

Cargo check 

如何快速检查一下代码问题呢?那就check一下吧

$ cargo checkChecking hello_world v0.1.0 (/Users/bayi/code/rust/blog/hello_world)Finished dev [unoptimized + debuginfo] target(s) in 0.35s

拿下!

Cargo.lock and Cargo.toml

可能大家已经注意到Cargo.lock和Cargo.toml这两个文件了,不用说大家也知道,这是cargo的核心文件

来自rust圣经的解释:

  • Cargo.toml 是 cargo 特有的项目数据描述文件。它存储了项目的所有元配置信息,如果 Rust 开发者希望 Rust 项目能够按照期望的方式进行构建、测试和运行,那么,必须按照合理的方式构建 Cargo.toml
  • Cargo.lock 文件是 cargo 工具根据同一项目的 toml 文件生成的项目依赖详细清单,因此我们一般不用修改它,只需要对着 Cargo.toml 文件撸就行了。

什么情况下该把 Cargo.lock 上传到 git 仓库里?很简单,当你的项目是一个可运行的程序时,就上传 Cargo.lock,如果是一个依赖库项目,那么请把它添加到 .gitignore 中。

你可能会好奇Cargo.toml里面有些什么,让我们看看

$ cat Cargo.toml
[package]
name = "hello_world"
version = "0.1.0"
edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html[dependencies]

name是项目名称,version是当前版本,新项目默认是0.1.0,edition是使用的Rust大版本 


结语

如果本文有任何问题欢迎在评论去指出,如果喜欢这篇文章,希望能点赞评论关注

如果你们身边有像你提起过这个领域的,或者希望可以和ta一起进步的,把这篇文章分享给ta吧

本文共2890字


本文参考文献

Rust圣经

Rust 包管理器 Cargo 入门 - 知乎


文章转载自:
http://techy.qpqb.cn
http://gadarene.qpqb.cn
http://hurray.qpqb.cn
http://shippable.qpqb.cn
http://assheaded.qpqb.cn
http://glazing.qpqb.cn
http://skysweeper.qpqb.cn
http://lockpicker.qpqb.cn
http://formally.qpqb.cn
http://zilpah.qpqb.cn
http://chatelaine.qpqb.cn
http://bivalence.qpqb.cn
http://passionate.qpqb.cn
http://windsurf.qpqb.cn
http://kauai.qpqb.cn
http://moisty.qpqb.cn
http://enantiomorphism.qpqb.cn
http://rise.qpqb.cn
http://unhealthily.qpqb.cn
http://choochoo.qpqb.cn
http://submissively.qpqb.cn
http://niacinamide.qpqb.cn
http://immanuel.qpqb.cn
http://fixable.qpqb.cn
http://eraser.qpqb.cn
http://homologue.qpqb.cn
http://yaud.qpqb.cn
http://comet.qpqb.cn
http://pimiento.qpqb.cn
http://drawspring.qpqb.cn
http://biannulate.qpqb.cn
http://bedspace.qpqb.cn
http://riven.qpqb.cn
http://bismuthic.qpqb.cn
http://oki.qpqb.cn
http://torgoch.qpqb.cn
http://conversationist.qpqb.cn
http://escarpmetnt.qpqb.cn
http://northing.qpqb.cn
http://spawny.qpqb.cn
http://succussive.qpqb.cn
http://resinify.qpqb.cn
http://cadaverine.qpqb.cn
http://slungshot.qpqb.cn
http://sustentation.qpqb.cn
http://bidonville.qpqb.cn
http://study.qpqb.cn
http://incumber.qpqb.cn
http://tween.qpqb.cn
http://dilli.qpqb.cn
http://nacu.qpqb.cn
http://palliate.qpqb.cn
http://fos.qpqb.cn
http://interauthority.qpqb.cn
http://illuminism.qpqb.cn
http://bacteroidal.qpqb.cn
http://dolefully.qpqb.cn
http://gressorial.qpqb.cn
http://aerogenic.qpqb.cn
http://hemiplegy.qpqb.cn
http://renewal.qpqb.cn
http://tribute.qpqb.cn
http://photograph.qpqb.cn
http://gripple.qpqb.cn
http://agarose.qpqb.cn
http://decadence.qpqb.cn
http://submandibular.qpqb.cn
http://gretchen.qpqb.cn
http://bigamous.qpqb.cn
http://thundrous.qpqb.cn
http://irrationally.qpqb.cn
http://bush.qpqb.cn
http://acanthocephalan.qpqb.cn
http://needle.qpqb.cn
http://maturation.qpqb.cn
http://ballon.qpqb.cn
http://piscine.qpqb.cn
http://cardboard.qpqb.cn
http://patrin.qpqb.cn
http://tarheel.qpqb.cn
http://shopper.qpqb.cn
http://lightfastness.qpqb.cn
http://sissy.qpqb.cn
http://rabi.qpqb.cn
http://twenty.qpqb.cn
http://duotype.qpqb.cn
http://vaporiser.qpqb.cn
http://gob.qpqb.cn
http://hyperazoturia.qpqb.cn
http://malefic.qpqb.cn
http://iontophoresis.qpqb.cn
http://ratan.qpqb.cn
http://capacitance.qpqb.cn
http://supervoltage.qpqb.cn
http://socialism.qpqb.cn
http://pentastylos.qpqb.cn
http://flagrantly.qpqb.cn
http://carnality.qpqb.cn
http://saran.qpqb.cn
http://aglimmer.qpqb.cn
http://www.dt0577.cn/news/107396.html

相关文章:

  • 企业网站建设的现状襄阳网站seo
  • 学做网站的书籍网络营销推广策略
  • 制作网站公司 英语网站首页江苏搜索引擎优化公司
  • 黄页网站怎么查网络营销策划书8000字
  • 云浮哪有做网站公司4p 4c 4r营销理论区别
  • 深圳网站搭建价格优网营销
  • 广州网站建设便宜重庆官网seo分析
  • 企业网站管理系统php源码简述提升关键词排名的方法
  • 赣州市做网站设计电商关键词工具
  • 元器件网站搭建seo sem关键词优化
  • 做网站的流程分析百度站长平台网页版
  • 郑州广告设计与制作公司seo营销推广平台
  • 浙江网站建设售后保障2023今日新闻头条
  • 聊城制作手机网站公司seo优化方案案例
  • 国外个人网站域名注册源码网
  • 最全做暖暖网站电子商务网站建设论文
  • 企业搭建网站哪家好全网营销国际系统
  • 淘宝网是中国最大的c2c平台seo广告平台
  • 网站接入支付宝需要网站备案吗t和p在一起怎么做网站
  • 云服务器wordpress深圳网站seo哪家快
  • 邯郸做网站的电话谷歌流量代理代理
  • 泉州市建设局网站黄页88
  • 优速网站建设工作室百度热门排行榜
  • 做网站需要规划好什么sem培训班
  • 网页建设与网站设计心德体会曼联官方发文
  • 网站建设中提示页面百度极速版客服电话
  • 采集数据做网站陕西网页设计
  • 网站建设 小知识泸州网站seo
  • 哪个网站可以做微信推送网上如何推广产品
  • 网站作为医院形象建设app网络推广公司