rust/src/libcore/core.rc

325 lines
6.1 KiB
Plaintext
Raw Normal View History

/*!
The Rust core library.
The Rust core library provides runtime features required by the language,
including the task scheduler and memory allocators, as well as library
support for Rust built-in types, platform abstractions, and other commonly
used features.
`core` includes modules corresponding to each of the integer types, each of
the floating point types, the `bool` type, tuples, characters, strings,
vectors (`vec`), shared boxes (`box`), and unsafe and borrowed pointers
2012-09-20 02:17:00 +02:00
(`ptr`). Additionally, `core` provides task management and creation (`task`),
communication primitives (`comm` and `pipes`), an efficient vector builder
(`dvec`), platform abstractions (`os` and `path`), basic I/O abstractions
(`io`), common traits (`cmp`, `num`, `to_str`), and complete bindings
to the C standard library (`libc`).
2012-09-20 02:17:00 +02:00
`core` is linked to all crates by default and its contents imported.
Implicitly, all crates behave as if they included the following prologue:
extern mod core;
use core::*;
*/
#[link(name = "core",
2012-08-30 23:05:49 +02:00
vers = "0.4",
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
#[comment = "The Rust core library"];
#[license = "MIT"];
#[crate_type = "lib"];
2012-04-19 10:00:52 +02:00
// Don't link to core. We are core.
#[no_core];
#[legacy_modes];
2012-09-27 23:08:37 +02:00
#[legacy_exports];
#[warn(vecs_implicitly_copyable)];
#[deny(non_camel_case_types)];
export int, i8, i16, i32, i64;
export uint, u8, u16, u32, u64;
export float, f32, f64;
export box, char, str, ptr, vec, at_vec, bool;
export either, option, result, iter;
2012-09-19 02:34:08 +02:00
export gc, io, libc, os, run, rand, sys, cast, logging;
export comm, task, future, pipes;
export extfmt;
2012-07-11 00:52:05 +02:00
// The test harness links against core, so don't include runtime in tests.
// FIXME (#2861): Uncomment this after snapshot gets updated.
//#[cfg(notest)]
export rt;
2012-01-17 19:43:29 +01:00
export tuple;
2012-07-05 23:38:59 +02:00
export to_str, to_bytes;
2012-09-03 22:09:24 +02:00
export from_str;
2012-08-02 01:12:23 +02:00
export util;
2012-05-10 02:30:31 +02:00
export dvec, dvec_iter;
2012-07-14 07:24:26 +02:00
export dlist, dlist_iter;
2012-07-30 19:55:44 +02:00
export send_map;
export hash;
export cmp;
2012-06-08 01:08:38 +02:00
export num;
export path;
export mutable;
export flate;
2012-08-28 01:26:35 +02:00
export unit;
export uniq;
export repr;
export cleanup;
export reflect;
// NDM seems to be necessary for resolve to work
export option_iter;
// This creates some APIs that I do not want to commit to, but it must be
// exported from core in order for uv to remain in std (see #2648).
export private;
2012-04-19 10:00:52 +02:00
// Built-in-type support modules
/// Operations and constants for `int`
#[path = "int-template"]
mod int {
pub use inst::{ pow };
#[path = "int.rs"]
mod inst;
}
/// Operations and constants for `i8`
#[path = "int-template"]
mod i8 {
#[path = "i8.rs"]
mod inst;
}
/// Operations and constants for `i16`
#[path = "int-template"]
mod i16 {
#[path = "i16.rs"]
mod inst;
}
/// Operations and constants for `i32`
#[path = "int-template"]
mod i32 {
#[path = "i32.rs"]
mod inst;
}
/// Operations and constants for `i64`
#[path = "int-template"]
mod i64 {
#[path = "i64.rs"]
mod inst;
}
/// Operations and constants for `uint`
#[legacy_exports]
#[path = "uint-template"]
mod uint {
#[legacy_exports];
use inst::{
div_ceil, div_round, div_floor, iterate,
next_power_of_two
};
export div_ceil, div_round, div_floor, iterate,
next_power_of_two;
#[path = "uint.rs"]
#[legacy_exports]
mod inst;
}
/// Operations and constants for `u8`
#[legacy_exports]
#[path = "uint-template"]
mod u8 {
#[legacy_exports];
use inst::is_ascii;
export is_ascii;
#[path = "u8.rs"]
#[legacy_exports]
mod inst;
}
/// Operations and constants for `u16`
#[legacy_exports]
#[path = "uint-template"]
mod u16 {
#[legacy_exports];
#[path = "u16.rs"]
#[legacy_exports]
mod inst;
}
/// Operations and constants for `u32`
#[legacy_exports]
#[path = "uint-template"]
mod u32 {
#[legacy_exports];
#[path = "u32.rs"]
#[legacy_exports]
mod inst;
}
/// Operations and constants for `u64`
#[legacy_exports]
#[path = "uint-template"]
mod u64 {
#[legacy_exports];
#[path = "u64.rs"]
#[legacy_exports]
mod inst;
}
2012-04-19 10:00:52 +02:00
mod box;
mod char;
mod float;
mod f32;
mod f64;
#[legacy_exports]
mod str;
#[legacy_exports]
mod ptr;
#[legacy_exports]
mod vec;
mod at_vec;
#[legacy_exports]
mod bool;
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod tuple;
#[legacy_exports]
2012-08-28 01:26:35 +02:00
mod unit;
#[legacy_exports]
2012-08-28 01:26:35 +02:00
mod uniq;
// Ubiquitous-utility-type modules
#[cfg(notest)]
mod ops;
mod cmp;
2012-06-08 01:08:38 +02:00
mod num;
#[legacy_exports]
mod hash;
#[legacy_exports]
mod either;
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod iter;
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod logging;
#[legacy_exports]
mod option;
#[path="iter-trait"]
mod option_iter {
#[legacy_exports];
#[path = "option.rs"]
#[legacy_exports]
mod inst;
}
#[legacy_exports]
mod result;
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod to_str;
#[legacy_exports]
2012-07-05 23:40:45 +02:00
mod to_bytes;
#[legacy_exports]
2012-09-03 22:09:24 +02:00
mod from_str;
#[legacy_exports]
mod util;
// Data structure modules
#[legacy_exports]
2012-05-10 02:30:31 +02:00
mod dvec;
#[path="iter-trait"]
mod dvec_iter {
#[legacy_exports];
2012-05-10 02:30:31 +02:00
#[path = "dvec.rs"]
#[legacy_exports]
2012-05-10 02:30:31 +02:00
mod inst;
}
#[legacy_exports]
mod dlist;
#[path="iter-trait"]
mod dlist_iter {
#[legacy_exports];
#[path ="dlist.rs"]
#[legacy_exports]
mod inst;
}
#[legacy_exports]
2012-07-30 19:55:44 +02:00
mod send_map;
2012-04-19 10:00:52 +02:00
// Concurrency
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod comm;
#[legacy_exports]
2012-09-20 02:29:54 +02:00
mod task {
#[legacy_exports];
#[legacy_exports]
2012-09-20 02:29:54 +02:00
mod local_data;
#[legacy_exports]
mod local_data_priv;
#[legacy_exports]
mod spawn;
#[legacy_exports]
mod rt;
2012-09-20 02:29:54 +02:00
}
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod future;
#[legacy_exports]
mod pipes;
// Runtime and language-primitive support
#[legacy_exports]
mod gc;
#[legacy_exports]
2012-04-19 10:00:52 +02:00
mod io;
mod libc;
2012-03-06 19:14:58 +01:00
mod os;
mod path;
2012-04-19 10:00:52 +02:00
mod rand;
mod run;
mod sys;
2012-09-19 02:34:08 +02:00
mod cast;
mod mutable;
mod flate;
mod repr;
mod cleanup;
mod reflect;
2012-04-19 10:00:52 +02:00
// Modules supporting compiler-generated code
// Exported but not part of the public interface
#[legacy_exports]
mod extfmt;
2012-07-11 00:52:05 +02:00
// The test harness links against core, so don't include runtime in tests.
#[cfg(notest)]
#[legacy_exports]
2012-07-11 00:52:05 +02:00
mod rt;
2012-04-19 10:00:52 +02:00
// For internal use, not exported
mod unicode;
mod private;
2012-04-19 10:00:52 +02:00
mod cmath;
2012-06-06 03:47:18 +02:00
mod stackwalk;
2012-04-19 10:00:52 +02:00
// Local Variables:
// mode: rust;
// fill-column: 78;
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// End: