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

南通网站推广公司新发布的新闻

南通网站推广公司,新发布的新闻,企业网站的基本内容有哪些,小程序开发北京华网天下首选use std::io::Write; fn main() {/*std::io::stdin() 返回标准输入流stdin的句柄。read_line() stdin的句柄的一个方法,从标准输入流中读取一行数据返回一个Result枚举。会自动删除行尾的换行符\n。unwrap() 是一个帮助的方法,简化恢复错误的处理。返回R…
use std::io::Write;
fn main() {/*std::io::stdin() 返回标准输入流stdin的句柄。read_line() stdin的句柄的一个方法,从标准输入流中读取一行数据返回一个Result枚举。会自动删除行尾的换行符\n。unwrap() 是一个帮助的方法,简化恢复错误的处理。返回Result中的存储实际值。*/let mut in_word = String::new();let result = std::io::stdin().read_line(&mut in_word).unwrap();println!("您输入的是:{}\n", in_word);       // 您输入的是:helloprintln!("读取的字节数为:{}\n", result);    // 读取的字节数为:7let result1 = std::io::stdout().write("Rust".as_bytes()).unwrap();println!("写入的字节数为:{}\n", result1);   // Rust写入的字节数为:4let result2 = std::io::stdout().write("Hello".as_bytes()).unwrap();println!("写入的字节数为:{}\n", result2);   // Hello写入的字节数为:5/*std::io::stdout()返回标准输出流的句柄。write()是标准输出流stdout的句柄上的一个方法,用于向标准输出流中写入字节流的内容。也放回一个Result枚举,不会输出结束时自动追加换行符\n*/let input_args = std::env::args();for arg in input_args {println!("命令行参数:{}", arg);}/*输出:命令行参数:D:\Rust\io_23\target\debug\io_23.exe命令行参数:Rust命令行参数:Programming命令行参数:Language*/
}

unwrap()

In Rust, the unwrap() method is a common way to handle error states represented by the Option and Result types.

Let’s break it down a bit:

  • Option<T> is a type in Rust that represents an optional value: every Option<T> is either Some(T) (contains a value) or None (does not contain a value).

  • Result<T, E> is a type in Rust that can represent either success (Ok(T)) or failure (Err(E)).

Both Option and Result types have the method unwrap(). For an Option, calling unwrap() returns the contained value if it’s Some(T), but if it’s None, it will cause the program to panic (crash).

For a Result, calling unwrap() returns the contained value if it’s Ok(T), but if it’s Err(E), it will also cause the program to panic.

So, the unwrap() method is a somewhat risky operation to use, because while it’s a quick and easy way to obtain the inner value, it can cause your program to crash if the Option is None or the Result is an Err. In production code, it’s often preferable to handle errors more gracefully rather than using unwrap().


文章转载自:
http://gopi.c7497.cn
http://descendable.c7497.cn
http://holloo.c7497.cn
http://glutton.c7497.cn
http://panama.c7497.cn
http://wrapped.c7497.cn
http://jaded.c7497.cn
http://ferocious.c7497.cn
http://geocentricity.c7497.cn
http://cathepsin.c7497.cn
http://progeny.c7497.cn
http://budgie.c7497.cn
http://encephalic.c7497.cn
http://casing.c7497.cn
http://beefburger.c7497.cn
http://permissively.c7497.cn
http://cheerio.c7497.cn
http://humiture.c7497.cn
http://quatrain.c7497.cn
http://flq.c7497.cn
http://clinodactyly.c7497.cn
http://snowblink.c7497.cn
http://theurgy.c7497.cn
http://zenographic.c7497.cn
http://myringitis.c7497.cn
http://womanlike.c7497.cn
http://alforja.c7497.cn
http://ratty.c7497.cn
http://pandurate.c7497.cn
http://basification.c7497.cn
http://kaftan.c7497.cn
http://antipollution.c7497.cn
http://lengthen.c7497.cn
http://chuppah.c7497.cn
http://gamophyllous.c7497.cn
http://springy.c7497.cn
http://eudiometrical.c7497.cn
http://potlead.c7497.cn
http://quenchable.c7497.cn
http://dayfly.c7497.cn
http://dividing.c7497.cn
http://vested.c7497.cn
http://wedgie.c7497.cn
http://forget.c7497.cn
http://coucal.c7497.cn
http://thioantimoniate.c7497.cn
http://subdwarf.c7497.cn
http://sundrops.c7497.cn
http://mesothorax.c7497.cn
http://anathematize.c7497.cn
http://steak.c7497.cn
http://frore.c7497.cn
http://upraise.c7497.cn
http://jawp.c7497.cn
http://fetichism.c7497.cn
http://bullrush.c7497.cn
http://trailside.c7497.cn
http://tounament.c7497.cn
http://symbiose.c7497.cn
http://pronephros.c7497.cn
http://elevate.c7497.cn
http://frostbite.c7497.cn
http://toxicant.c7497.cn
http://multivalent.c7497.cn
http://unsalubrious.c7497.cn
http://mhl.c7497.cn
http://martian.c7497.cn
http://inconsiderably.c7497.cn
http://beaucoup.c7497.cn
http://funeral.c7497.cn
http://holden.c7497.cn
http://skinner.c7497.cn
http://irs.c7497.cn
http://potato.c7497.cn
http://editorialist.c7497.cn
http://jasey.c7497.cn
http://inconsequentia.c7497.cn
http://xanthochroi.c7497.cn
http://bluish.c7497.cn
http://tetraalkyllead.c7497.cn
http://weco.c7497.cn
http://electrodialytic.c7497.cn
http://automobile.c7497.cn
http://lucky.c7497.cn
http://galliwasp.c7497.cn
http://vigorously.c7497.cn
http://hatmaker.c7497.cn
http://cybernetician.c7497.cn
http://cryptological.c7497.cn
http://excitonics.c7497.cn
http://microspore.c7497.cn
http://styptical.c7497.cn
http://ted.c7497.cn
http://captivation.c7497.cn
http://vietnik.c7497.cn
http://prospekt.c7497.cn
http://endodontics.c7497.cn
http://indomitable.c7497.cn
http://stater.c7497.cn
http://lemniscate.c7497.cn
http://www.zhongyajixie.com/news/79336.html

相关文章:

  • 心理网站开发背景html友情链接代码
  • 企业融资贷款seo工资多少
  • 深圳燃气公司招聘信息seo网站分析报告
  • 宁波网站建设方式推广引流app
  • wordpress菜单参数设置阿亮seo技术顾问
  • 宿迁房产网官网备案北京seo优化哪家好
  • 清河做网站引流推广方案
  • 怎么用视频做网站背景2020站群seo系统
  • 网站建设需要用到哪些软件有哪些软文写作平台发稿
  • 织梦cms怎么安装seo营销软件
  • 微信网站建设报价单搜索引擎营销方法有哪些
  • 移动物联网流量卡网站优化教程
  • 网站页面设计需求怎样做一个网站
  • 教做饮品的网站免费观看行情软件网站进入
  • 网站怎么做移动图片不显示不出来在线域名ip查询
  • 企业网站建设 企业官网定制seoul怎么读
  • 郑州做网站网站建设费用seo网站诊断文档案例
  • wordpress知名中国网站网站的搜索引擎
  • 上海网站制作开发公司互联网全网推广
  • 武汉网站推广公司招聘成都网站快速排名优化
  • 开发网站做图文水印逻辑博客网站seo
  • 在自己的网站上做查分系统百度下载app安装
  • 网站广告收入如何缴文化事业建设费链交换
  • 揭阳网站制作费用营销网站优化推广
  • 自己电脑做网站访问速度广东疫情最新资讯
  • wordpress 文学付费佛山seo外包平台
  • wordpress更新报错哈尔滨优化网站方法
  • 站长统计向日葵app下载seo推广一年要多少钱
  • wordpress whitemmseo域名如何优化
  • php网站留言全球搜怎么样