debug:
Debugtrait を標準化 し、調査 や診断 に使 う文字列表現 を揃 えます。
Debugは利用者 向け表示 とは限 りません。安定 した外部形式 が必要 な場合 はSerializeを使 う予定 です。
- 各 impl に
依存 します。
Debug:
debug_string: trait を
TEST
#entry main
#target std
#import "std/test" as *
#import "core/traits/debug" as *
fn main <()*>i32> ():
assert_str_eq "\"hi\"" debug_string "hi";
assert_str_eq "7" debug_string 7;
0呼 び出 し側 で trait名 を意識 せず debug表示 を得 ます。
Debug::debug_string xをそのまま呼 びます。
strは通常 の stringify と区別 できるよう、引用符 を付 けて返 します。
- impl に
依存 します。