rust/src/libcore/core.rs

105 lines
2.9 KiB
Rust
Raw Normal View History

// Top-level, visible-everywhere definitions.
// Export various ubiquitous types, constructors, methods.
#[legacy_exports];
2012-09-04 13:12:17 -05:00
use option::{Some, None};
use Option = option::Option;
use result::{Result, Ok, Err};
2012-09-04 13:12:17 -05:00
use Path = path::Path;
use GenericPath = path::GenericPath;
use WindowsPath = path::WindowsPath;
use PosixPath = path::PosixPath;
2012-09-04 13:12:17 -05:00
use tuple::{TupleOps, ExtendedTupleOps};
use str::{StrSlice, UniqueStr};
use vec::{ConstVector, CopyableVector, ImmutableVector};
use vec::{ImmutableEqVector, ImmutableCopyableVector};
use vec::{MutableVector, MutableCopyableVector};
2012-09-04 13:12:17 -05:00
use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
use iter::{CopyableOrderedIter, Times, TimesIx};
use num::Num;
use ptr::Ptr;
use to_str::ToStr;
2012-03-17 20:02:45 -05:00
export Path, WindowsPath, PosixPath, GenericPath;
export Option, Some, None;
2012-08-28 22:16:21 -05:00
export Result, Ok, Err;
2012-03-16 19:35:38 -05:00
export extensions;
// The following exports are the extension impls for numeric types
2012-08-14 18:54:13 -05:00
export Num, Times, TimesIx;
// The following exports are the common traits
2012-08-14 18:54:13 -05:00
export StrSlice, UniqueStr;
export ConstVector, CopyableVector, ImmutableVector;
2012-08-27 18:26:35 -05:00
export ImmutableEqVector, ImmutableCopyableVector, IterTraitExtensions;
export MutableVector, MutableCopyableVector;
2012-08-27 18:26:35 -05:00
export BaseIter, CopyableIter, CopyableOrderedIter, ExtendedIter, EqIter;
export TupleOps, ExtendedTupleOps;
2012-08-14 18:54:13 -05:00
export Ptr;
export ToStr;
// The following exports are the core operators and kinds
// The compiler has special knowlege of these so we must not duplicate them
// when compiling for testing
#[cfg(notest)]
2012-09-04 13:12:17 -05:00
use ops::{Const, Copy, Send, Owned};
#[cfg(notest)]
2012-09-04 13:12:17 -05:00
use ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
#[cfg(notest)]
2012-09-04 13:12:17 -05:00
use ops::{Shl, Shr, Index};
#[cfg(notest)]
2012-09-02 20:13:48 -05:00
export Const, Copy, Send, Owned;
#[cfg(notest)]
2012-09-02 20:13:48 -05:00
export Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor;
2012-07-28 16:14:17 -05:00
#[cfg(notest)]
2012-09-02 20:13:48 -05:00
export Shl, Shr, Index;
#[cfg(test)]
extern mod coreops(name = "core", vers = "0.4");
#[cfg(test)]
2012-09-04 13:12:17 -05:00
use coreops::ops::{Const, Copy, Send, Owned};
#[cfg(test)]
2012-09-04 13:12:17 -05:00
use coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
#[cfg(test)]
2012-09-04 13:12:17 -05:00
use coreops::ops::{Shl, Shr, Index};
// 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
/// The error log level
const error : u32 = 0_u32;
/// The warning log level
const warn : u32 = 1_u32;
/// The info log level
const info : u32 = 2_u32;
/// 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.
#[doc(hidden)] // FIXME #3538
mod core {
#[legacy_exports];
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 {
#[legacy_exports];
extern mod std(vers = "0.4");
use std::test;
}