rust/src/libcore/core.rs

41 lines
1.1 KiB
Rust
Raw Normal View History

// Top-level, visible-everywhere definitions.
// Export type option as a synonym for option and export the some and none
2012-01-19 17:56:54 -06:00
// enum constructors.
import option::{some, none};
import option = option::t;
export option, some, none;
// Export the log levels as global constants. Higher levels mean
// more-verbosity. Error is the bottom level, default logging level is
// warn-and-below.
export error, warn, info, debug;
2012-01-24 02:54:17 -06:00
#[doc = "The error log level"]
const error : u32 = 0_u32;
2012-01-24 02:54:17 -06:00
#[doc = "The warning log level"]
const warn : u32 = 1_u32;
2012-01-24 02:54:17 -06:00
#[doc = "The info log level"]
const info : u32 = 2_u32;
2012-01-24 02:54:17 -06:00
#[doc = "The debug log level"]
const debug : u32 = 3_u32;
// A curious inner-module that's not exported that contains the binding
// 'core' so that macro-expanded references to core::error and such
// can be resolved within libcore.
mod core {
const error : u32 = 0_u32;
const warn : u32 = 1_u32;
const info : u32 = 2_u32;
const debug : u32 = 3_u32;
2012-01-17 18:45:22 -06:00
}
// Similar to above. Some magic to make core testable.
#[cfg(test)]
mod std {
use std;
import std::test;
}