0
グローバル定数を定義することは可能です。その値は実行時の開始時に計算されますか?可能であれば、グローバル定数は、実行時にRustで初期化されますか?
static START_TIME: time::Timespec = time::get_time();
のようなものです。 static
とconst
宣言にはコンパイル時の値(calls in constants are limited to struct and enum constructors
)が必要で、関数(error: expected item, found `let`
)の外に置くことはできません。