
rust学习
HardRedStone
这个作者很懒,什么都没留下…
展开
-
Rust Rpc框架
框架仓库https://github.com/paritytech/jsonrpc#readme使用1.依赖[dependencies]jsonrpc-core = "18.0.0"jsonrpc-core-client = "18.0.0"jsonrpc-http-server = "18.0.0"jsonrpc-ipc-server = "18.0.0"jsonrpc-tcp-server= "18.0.0"jsonrpc-ws-server = "18.0.0"js原创 2022-01-13 14:47:33 · 1194 阅读 · 0 评论 -
Rust 刷leetcode 第二题
题目描述力扣// Definition for singly-linked list.#[derive(PartialEq, Eq, Clone, Debug)]pub struct ListNode { pub val: i32, pub next: Option<Box<ListNode>>,}struct Solution {}impl Solution { pub fn add_two_numbers( l1原创 2022-01-07 14:26:41 · 411 阅读 · 1 评论 -
Rust中如何获取时间戳
不需要引入第三方依赖,直接用系统自带的库。use std::time::{SystemTime, UNIX_EPOCH};match SystemTime::now().duration_since(UNIX_EPOCH) { Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()), Err(_) => panic!("SystemTime before UNIX E原创 2021-12-31 10:56:08 · 3755 阅读 · 0 评论