<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/tag/debug-helper/feed</link><description>多元化原創文章，內容包羅萬象，有程式語言、網站應用、軟體介紹、硬體介紹、作業系統、旅行遊記、專題採訪、益智問題、文學創作，以及作者們的知識分享和作品分享。</description><language>zh-TW</language><lastBuildDate>Wed, 8 Apr 2026 08:22:41 +0000</lastBuildDate><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>如何用Rust程式語言替我們自己的型別實作Debug特性？</title><link>https://magiclen.org/debug-helper</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
Rust程式語言內建的「Debug」特性非常方便，可以直接將任意型別的值以字串的方式顯示出來，而且還可以支援一定程度的格式化方式。在一般的情況下，要替我們自己的一個型別實作「Debug」特性，只需在其「derive」屬性加上「Debug」參數就好了，沒有什麼難度。但是在比較特別的情況下，我們就無法用「derive」屬性來實作「Debug」特性。]]></description><category>Rust</category><category>Rust</category><category>debug-helper</category><guid>https://magiclen.org/debug-helper</guid><pubDate>Tue, 15 Oct 2019 20:00:39 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>