-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70e951c
commit f8f19c8
Showing
71 changed files
with
864 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<!doctype html><html lang=zh dir=auto><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>rust | 自由庄园</title><meta name=keywords content><meta name=description content="In Pursuit of Hubris"><meta name=author content="Ramsay Leung"><link rel=canonical href=https://ramsayleung.github.io/zh/categories/rust/><meta name=google-site-verification content="XYZabc"><meta name=yandex-verification content="XYZabc"><meta name=msvalidate.01 content="XYZabc"><link crossorigin=anonymous href=/assets/css/stylesheet.5cfc680b1eeaeef9efbced92d46c2a9e876b72ee14fba85846afc4cff9e6e6f8.css integrity="sha256-XPxoCx7q7vnvvO2S1Gwqnodrcu4U+6hYRq/Ez/nm5vg=" rel="preload stylesheet" as=style><link rel=icon href=https://ramsayleung.github.io/favicon.ico><link rel=icon type=image/png sizes=16x16 href=https://ramsayleung.github.io/favicon-16x16.png><link rel=icon type=image/png sizes=32x32 href=https://ramsayleung.github.io/favicon-32x32.png><link rel=apple-touch-icon href=https://ramsayleung.github.io/apple-touch-icon.png><link rel=mask-icon href=https://ramsayleung.github.io/%3Clink%20/%20abs%20url%3E><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://ramsayleung.github.io/zh/categories/rust/index.xml><link rel=alternate hreflang=en href=https://ramsayleung.github.io/en/categories/rust/><link rel=alternate hreflang=zh href=https://ramsayleung.github.io/zh/categories/rust/><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--hljs-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><script async src="https://www.googletagmanager.com/gtag/js?id=G-9MG65HQHEL"></script> | ||
<script>var doNotTrack=!1;if(!doNotTrack){window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-9MG65HQHEL",{anonymize_ip:!1})}</script><meta property="og:title" content="rust"><meta property="og:description" content="In Pursuit of Hubris"><meta property="og:type" content="website"><meta property="og:url" content="https://ramsayleung.github.io/zh/categories/rust/"><meta property="og:image" content="https://ramsayleung.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="自由庄园"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://ramsayleung.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="rust"><meta name=twitter:description content="In Pursuit of Hubris"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://ramsayleung.github.io/zh/ accesskey=h title="Home (Alt + H)"><img src=https://ramsayleung.github.io/apple-touch-icon.png alt aria-label=logo height=35>Home</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button><ul class=lang-switch><li>|</li><li><a href=https://ramsayleung.github.io/en/ title=English aria-label=English>En</a></li></ul></div></div><ul id=menu><li><a href=https://ramsayleung.github.io/zh/archives/ title=归档><span>归档</span></a></li><li><a href=https://ramsayleung.github.io/zh/search/ title=搜索><span>搜索</span></a></li><li><a href=https://ramsayleung.github.io/zh/categories/ title=目录><span>目录</span></a></li><li><a href=https://ramsayleung.github.io/zh/tags/ title=标签><span>标签</span></a></li><li><a href=https://ramsayleung.github.io/zh/about_me_zh/ title=关于><span>关于</span></a></li></ul></nav></header><main class=main><header class=page-header><div class=breadcrumbs><a href=https://ramsayleung.github.io/zh/>主页</a></div><h1>rust | ||
<a href=/zh/categories/rust/index.xml title=RSS aria-label=RSS><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23"><path d="M4 11a9 9 0 019 9"/><path d="M4 4a16 16 0 0116 16"/><circle cx="5" cy="19" r="1"/></svg></a></h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>Rust模拟C++的函数重载</h2></header><div class=entry-content><p>1 函数重载(function overloading) 所谓的函数重载,指的是某些语言支持创建函数名相同,但函数签名不同的多个函数,所谓的函数签名,既指参数类型,也指...</p></div><footer class=entry-footer><span title='2024-08-30 22:23:00 -0700 -0700'>八月 30, 2024</span> · 2 分钟 · 827 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to Rust模拟C++的函数重载" href=https://ramsayleung.github.io/zh/post/2024/rust%E6%A8%A1%E6%8B%9Fc++%E7%9A%84%E5%87%BD%E6%95%B0%E9%87%8D%E8%BD%BD/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Let's make everything iterable</h2></header><div class=entry-content><p>Iterate through pagination in the Rest API | ||
<a href=/zh/categories/rust/index.xml title=RSS aria-label=RSS><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23"><path d="M4 11a9 9 0 019 9"/><path d="M4 4a16 16 0 0116 16"/><circle cx="5" cy="19" r="1"/></svg></a></h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>使用Rust的Iterator优雅解决FizzBuzz问题</h2></header><div class=entry-content><p>1 前言 按照维基百科的说法,FizzBuzz问题 是一个简单但是常见的面试编程问题(可能以前常见,现在都是考Leetcode了,这种连Easy 都...</p></div><footer class=entry-footer><span title='2024-09-18 22:46:00 -0700 -0700'>九月 18, 2024</span> · 4 分钟 · 1719 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to 使用Rust的Iterator优雅解决FizzBuzz问题" href=https://ramsayleung.github.io/zh/post/2024/%E4%BD%BF%E7%94%A8rust%E7%9A%84iterator%E8%A7%A3%E5%86%B3fizzbuzz%E9%97%AE%E9%A2%98/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Rust模拟C++的函数重载</h2></header><div class=entry-content><p>1 函数重载(function overloading) 所谓的函数重载,指的是某些语言支持创建函数名相同,但函数签名不同的多个函数,所谓的函数签名,既指参数类型,也指...</p></div><footer class=entry-footer><span title='2024-08-30 22:23:00 -0700 -0700'>八月 30, 2024</span> · 2 分钟 · 827 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to Rust模拟C++的函数重载" href=https://ramsayleung.github.io/zh/post/2024/rust%E6%A8%A1%E6%8B%9Fc++%E7%9A%84%E5%87%BD%E6%95%B0%E9%87%8D%E8%BD%BD/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Let's make everything iterable</h2></header><div class=entry-content><p>Iterate through pagination in the Rest API | ||
1 Preface About 4 months ago, icewind1991 created an exciting PR that adding Stream/Iterator based versions of methods with paginated results, which makes enpoints in Rspotify more much ergonomic to use, and Mario completed this PR. | ||
In order to know what this PR brought to us, we have to go back to the orignal story, the paginated results in Spotify’s Rest API. | ||
2 Orignal Story Taking the artist_albums as example, it gets Spotify catalog information about an artist’s albums....</p></div><footer class=entry-footer><span title='2021-04-29 11:48:00 +0800 +0800'>四月 29, 2021</span> · 5 分钟 · 1004 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to Let's make everything iterable" href=https://ramsayleung.github.io/zh/post/2021/iterate_through_pagination_api/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Serde Tricks</h2></header><div class=entry-content><p>The lesson learned from refactoring rspotify | ||
1 Preface Recently, I and Mario are working on refactoring rspotify, trying to improve performance, documentation, error-handling, data model and reduce compile time, to make it easier to use. (For those who has never heard about rspotify, it is a Spotify HTTP SDK implemented in Rust). | ||
I am partly focusing on polishing the data model, based on the issue created by Koxiaet. | ||
Since rspotify is API client for Spotify, it has to handle the request and response from Spotify HTTP API....</p></div><footer class=entry-footer><span title='2020-12-13 22:29:00 +0800 +0800'>十二月 13, 2020</span> · 10 分钟 · 2007 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to Serde Tricks" href=https://ramsayleung.github.io/zh/post/2020/serde_lesson/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>rspotify has come to async/await</h2></header><div class=entry-content><p>1 Preface Today, I am exited to introduce you the v0.9 release I have been continued to work on it for the past few weeks that adds async/await support now! | ||
2 The road to async/await What is rspotify: > For those who has never heared about rspotify before, rspotify is a Spotify web Api wrapper implemented in Rust. | ||
With async/await’s forthcoming stabilization and reqwest adds async/await support now, I think it’s time to let rspotify leverage power from async/await....</p></div><footer class=entry-footer><span title='2020-02-28 01:27:00 +0800 +0800'>二月 28, 2020</span> · 3 分钟 · 432 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to rspotify has come to async/await" href=https://ramsayleung.github.io/zh/post/2020/async_await_for_rspotify/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>rspotify– 我的第一个Rust crate</h2></header><div class=entry-content><p>开发第一个Rust crate 的感受和踩到的坑 最近写了人生第一个 Rust crate– rspotify. 虽说并不是什么惊天地,泣鬼神的大作,但是也是我花费了近两个月实现的。 现在就来聊聊...</p></div><footer class=entry-footer><span title='2018-02-28 20:44:00 +0800 +0800'>二月 28, 2018</span> · 4 分钟 · 1760 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to rspotify– 我的第一个Rust crate" href=https://ramsayleung.github.io/zh/post/2018/rspotify/></a></article><footer class=page-footer><nav class=pagination><a class=next href=https://ramsayleung.github.io/zh/categories/rust/page/2/>下一页 »</a></nav></footer></main><footer class=footer><span>See this site’s source code <a href=https://github.com/ramsayleung/ramsayleung.github.io>here</a>, licensed under GPLv3 ·</span> | ||
With async/await’s forthcoming stabilization and reqwest adds async/await support now, I think it’s time to let rspotify leverage power from async/await....</p></div><footer class=entry-footer><span title='2020-02-28 01:27:00 +0800 +0800'>二月 28, 2020</span> · 3 分钟 · 432 字 · Ramsay Leung</footer><a class=entry-link aria-label="post link to rspotify has come to async/await" href=https://ramsayleung.github.io/zh/post/2020/async_await_for_rspotify/></a></article><footer class=page-footer><nav class=pagination><a class=next href=https://ramsayleung.github.io/zh/categories/rust/page/2/>下一页 »</a></nav></footer></main><footer class=footer><span>See this site’s source code <a href=https://github.com/ramsayleung/ramsayleung.github.io>here</a>, licensed under GPLv3 ·</span> | ||
<span>Powered by | ||
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> & | ||
<a href=https://github.com/adityatelange/hugo-PaperMod/ rel=noopener target=_blank>PaperMod</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg></a><script>let menu=document.getElementById("menu");menu&&(menu.scrollLeft=localStorage.getItem("menu-scroll-position"),menu.onscroll=function(){localStorage.setItem("menu-scroll-position",menu.scrollLeft)}),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){e.preventDefault();var t=this.getAttribute("href").substr(1);window.matchMedia("(prefers-reduced-motion: reduce)").matches?document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView():document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView({behavior:"smooth"}),t==="top"?history.replaceState(null,null," "):history.pushState(null,null,`#${t}`)})})</script><script>var mybutton=document.getElementById("top-link");window.onscroll=function(){document.body.scrollTop>800||document.documentElement.scrollTop>800?(mybutton.style.visibility="visible",mybutton.style.opacity="1"):(mybutton.style.visibility="hidden",mybutton.style.opacity="0")}</script><script>document.getElementById("theme-toggle").addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove("dark"),localStorage.setItem("pref-theme","light")):(document.body.classList.add("dark"),localStorage.setItem("pref-theme","dark"))})</script></body></html> |
Oops, something went wrong.