博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2020年3月24日

摘要: trait Bird { fn fly(&self); } struct Duck{x:i32} struct Swan{x:i64} impl Bird for Duck { fn fly(&self) { println!("duck duck"); } } impl Bird for Swan 阅读全文

posted @ 2020-03-24 22:54 liufu627 阅读(1203) 评论(0) 推荐(0)

摘要: # Rust异步网络编程 Rust的高性能异步网络编程模式目前是基于mio和futures这两个库构建的生态。 Tokio则连接这2个库构建了一个异步非阻塞事件驱动编程平台。 # 什么是 mio,futures,tokio ## 1- Mio Mio是Rust的轻量级快速低级IO库,专注于非阻塞AP 阅读全文

posted @ 2020-03-24 22:29 liufu627 阅读(2074) 评论(0) 推荐(0)

摘要: # Rust学习 ## Rust安装 1. 直接访问官网 https://www.rust-lang.org/tools/install 下载相应的版本进行安装。 2. 如果是Windows版本的Rust,需要安装Visual Studio 2012以上版本的VC++ 才能编译通过 3. 在命令行窗 阅读全文

posted @ 2020-03-24 22:27 liufu627 阅读(405) 评论(0) 推荐(0)