Finish de-exporting std. Part of #3583.
This commit is contained in:
parent
56c9c81522
commit
a06b90322c
|
@ -4,7 +4,7 @@
|
|||
Core serialization interfaces.
|
||||
*/
|
||||
|
||||
trait Serializer {
|
||||
pub trait Serializer {
|
||||
// Primitive types:
|
||||
fn emit_nil();
|
||||
fn emit_uint(v: uint);
|
||||
|
@ -37,7 +37,7 @@ trait Serializer {
|
|||
fn emit_tup_elt(idx: uint, f: fn());
|
||||
}
|
||||
|
||||
trait Deserializer {
|
||||
pub trait Deserializer {
|
||||
// Primitive types:
|
||||
fn read_nil() -> ();
|
||||
|
||||
|
@ -81,7 +81,7 @@ trait Deserializer {
|
|||
//
|
||||
// In some cases, these should eventually be coded as traits.
|
||||
|
||||
fn emit_from_vec<S: Serializer, T>(&&s: S, &&v: ~[T], f: fn(&&x: T)) {
|
||||
pub fn emit_from_vec<S: Serializer, T>(&&s: S, &&v: ~[T], f: fn(&&x: T)) {
|
||||
do s.emit_vec(vec::len(v)) {
|
||||
for vec::eachi(v) |i,e| {
|
||||
do s.emit_vec_elt(i) {
|
||||
|
@ -91,7 +91,7 @@ fn emit_from_vec<S: Serializer, T>(&&s: S, &&v: ~[T], f: fn(&&x: T)) {
|
|||
}
|
||||
}
|
||||
|
||||
fn read_to_vec<D: Deserializer, T: Copy>(&&d: D, f: fn() -> T) -> ~[T] {
|
||||
pub fn read_to_vec<D: Deserializer, T: Copy>(&&d: D, f: fn() -> T) -> ~[T] {
|
||||
do d.read_vec |len| {
|
||||
do vec::from_fn(len) |i| {
|
||||
d.read_vec_elt(i, || f())
|
||||
|
@ -99,7 +99,7 @@ fn read_to_vec<D: Deserializer, T: Copy>(&&d: D, f: fn() -> T) -> ~[T] {
|
|||
}
|
||||
}
|
||||
|
||||
trait SerializerHelpers {
|
||||
pub trait SerializerHelpers {
|
||||
fn emit_from_vec<T>(&&v: ~[T], f: fn(&&x: T));
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ impl<S: Serializer> S: SerializerHelpers {
|
|||
}
|
||||
}
|
||||
|
||||
trait DeserializerHelpers {
|
||||
pub trait DeserializerHelpers {
|
||||
fn read_to_vec<T: Copy>(f: fn() -> T) -> ~[T];
|
||||
}
|
||||
|
||||
|
@ -119,127 +119,127 @@ impl<D: Deserializer> D: DeserializerHelpers {
|
|||
}
|
||||
}
|
||||
|
||||
fn serialize_uint<S: Serializer>(&&s: S, v: uint) {
|
||||
pub fn serialize_uint<S: Serializer>(&&s: S, v: uint) {
|
||||
s.emit_uint(v);
|
||||
}
|
||||
|
||||
fn deserialize_uint<D: Deserializer>(&&d: D) -> uint {
|
||||
pub fn deserialize_uint<D: Deserializer>(&&d: D) -> uint {
|
||||
d.read_uint()
|
||||
}
|
||||
|
||||
fn serialize_u8<S: Serializer>(&&s: S, v: u8) {
|
||||
pub fn serialize_u8<S: Serializer>(&&s: S, v: u8) {
|
||||
s.emit_u8(v);
|
||||
}
|
||||
|
||||
fn deserialize_u8<D: Deserializer>(&&d: D) -> u8 {
|
||||
pub fn deserialize_u8<D: Deserializer>(&&d: D) -> u8 {
|
||||
d.read_u8()
|
||||
}
|
||||
|
||||
fn serialize_u16<S: Serializer>(&&s: S, v: u16) {
|
||||
pub fn serialize_u16<S: Serializer>(&&s: S, v: u16) {
|
||||
s.emit_u16(v);
|
||||
}
|
||||
|
||||
fn deserialize_u16<D: Deserializer>(&&d: D) -> u16 {
|
||||
pub fn deserialize_u16<D: Deserializer>(&&d: D) -> u16 {
|
||||
d.read_u16()
|
||||
}
|
||||
|
||||
fn serialize_u32<S: Serializer>(&&s: S, v: u32) {
|
||||
pub fn serialize_u32<S: Serializer>(&&s: S, v: u32) {
|
||||
s.emit_u32(v);
|
||||
}
|
||||
|
||||
fn deserialize_u32<D: Deserializer>(&&d: D) -> u32 {
|
||||
pub fn deserialize_u32<D: Deserializer>(&&d: D) -> u32 {
|
||||
d.read_u32()
|
||||
}
|
||||
|
||||
fn serialize_u64<S: Serializer>(&&s: S, v: u64) {
|
||||
pub fn serialize_u64<S: Serializer>(&&s: S, v: u64) {
|
||||
s.emit_u64(v);
|
||||
}
|
||||
|
||||
fn deserialize_u64<D: Deserializer>(&&d: D) -> u64 {
|
||||
pub fn deserialize_u64<D: Deserializer>(&&d: D) -> u64 {
|
||||
d.read_u64()
|
||||
}
|
||||
|
||||
fn serialize_int<S: Serializer>(&&s: S, v: int) {
|
||||
pub fn serialize_int<S: Serializer>(&&s: S, v: int) {
|
||||
s.emit_int(v);
|
||||
}
|
||||
|
||||
fn deserialize_int<D: Deserializer>(&&d: D) -> int {
|
||||
pub fn deserialize_int<D: Deserializer>(&&d: D) -> int {
|
||||
d.read_int()
|
||||
}
|
||||
|
||||
fn serialize_i8<S: Serializer>(&&s: S, v: i8) {
|
||||
pub fn serialize_i8<S: Serializer>(&&s: S, v: i8) {
|
||||
s.emit_i8(v);
|
||||
}
|
||||
|
||||
fn deserialize_i8<D: Deserializer>(&&d: D) -> i8 {
|
||||
pub fn deserialize_i8<D: Deserializer>(&&d: D) -> i8 {
|
||||
d.read_i8()
|
||||
}
|
||||
|
||||
fn serialize_i16<S: Serializer>(&&s: S, v: i16) {
|
||||
pub fn serialize_i16<S: Serializer>(&&s: S, v: i16) {
|
||||
s.emit_i16(v);
|
||||
}
|
||||
|
||||
fn deserialize_i16<D: Deserializer>(&&d: D) -> i16 {
|
||||
pub fn deserialize_i16<D: Deserializer>(&&d: D) -> i16 {
|
||||
d.read_i16()
|
||||
}
|
||||
|
||||
fn serialize_i32<S: Serializer>(&&s: S, v: i32) {
|
||||
pub fn serialize_i32<S: Serializer>(&&s: S, v: i32) {
|
||||
s.emit_i32(v);
|
||||
}
|
||||
|
||||
fn deserialize_i32<D: Deserializer>(&&d: D) -> i32 {
|
||||
pub fn deserialize_i32<D: Deserializer>(&&d: D) -> i32 {
|
||||
d.read_i32()
|
||||
}
|
||||
|
||||
fn serialize_i64<S: Serializer>(&&s: S, v: i64) {
|
||||
pub fn serialize_i64<S: Serializer>(&&s: S, v: i64) {
|
||||
s.emit_i64(v);
|
||||
}
|
||||
|
||||
fn deserialize_i64<D: Deserializer>(&&d: D) -> i64 {
|
||||
pub fn deserialize_i64<D: Deserializer>(&&d: D) -> i64 {
|
||||
d.read_i64()
|
||||
}
|
||||
|
||||
fn serialize_str<S: Serializer>(&&s: S, v: &str) {
|
||||
pub fn serialize_str<S: Serializer>(&&s: S, v: &str) {
|
||||
s.emit_str(v);
|
||||
}
|
||||
|
||||
fn deserialize_str<D: Deserializer>(&&d: D) -> ~str {
|
||||
pub fn deserialize_str<D: Deserializer>(&&d: D) -> ~str {
|
||||
d.read_str()
|
||||
}
|
||||
|
||||
fn serialize_float<S: Serializer>(&&s: S, v: float) {
|
||||
pub fn serialize_float<S: Serializer>(&&s: S, v: float) {
|
||||
s.emit_float(v);
|
||||
}
|
||||
|
||||
fn deserialize_float<D: Deserializer>(&&d: D) -> float {
|
||||
pub fn deserialize_float<D: Deserializer>(&&d: D) -> float {
|
||||
d.read_float()
|
||||
}
|
||||
|
||||
fn serialize_f32<S: Serializer>(&&s: S, v: f32) {
|
||||
pub fn serialize_f32<S: Serializer>(&&s: S, v: f32) {
|
||||
s.emit_f32(v);
|
||||
}
|
||||
|
||||
fn deserialize_f32<D: Deserializer>(&&d: D) -> f32 {
|
||||
pub fn deserialize_f32<D: Deserializer>(&&d: D) -> f32 {
|
||||
d.read_f32()
|
||||
}
|
||||
|
||||
fn serialize_f64<S: Serializer>(&&s: S, v: f64) {
|
||||
pub fn serialize_f64<S: Serializer>(&&s: S, v: f64) {
|
||||
s.emit_f64(v);
|
||||
}
|
||||
|
||||
fn deserialize_f64<D: Deserializer>(&&d: D) -> f64 {
|
||||
pub fn deserialize_f64<D: Deserializer>(&&d: D) -> f64 {
|
||||
d.read_f64()
|
||||
}
|
||||
|
||||
fn serialize_bool<S: Serializer>(&&s: S, v: bool) {
|
||||
pub fn serialize_bool<S: Serializer>(&&s: S, v: bool) {
|
||||
s.emit_bool(v);
|
||||
}
|
||||
|
||||
fn deserialize_bool<D: Deserializer>(&&d: D) -> bool {
|
||||
pub fn deserialize_bool<D: Deserializer>(&&d: D) -> bool {
|
||||
d.read_bool()
|
||||
}
|
||||
|
||||
fn serialize_Option<S: Serializer,T>(&&s: S, &&v: Option<T>, st: fn(&&x: T)) {
|
||||
pub fn serialize_Option<S: Serializer,T>(&&s: S, &&v: Option<T>, st: fn(&&x: T)) {
|
||||
do s.emit_enum(~"option") {
|
||||
match v {
|
||||
None => do s.emit_enum_variant(~"none", 0u, 0u) {
|
||||
|
@ -254,7 +254,7 @@ fn serialize_Option<S: Serializer,T>(&&s: S, &&v: Option<T>, st: fn(&&x: T)) {
|
|||
}
|
||||
}
|
||||
|
||||
fn deserialize_Option<D: Deserializer,T: Copy>(&&d: D, st: fn() -> T)
|
||||
pub fn deserialize_Option<D: Deserializer,T: Copy>(&&d: D, st: fn() -> T)
|
||||
-> Option<T> {
|
||||
do d.read_enum(~"option") {
|
||||
do d.read_enum_variant |i| {
|
||||
|
|
|
@ -18,8 +18,6 @@ not required in or otherwise suitable for the core library.
|
|||
|
||||
#[no_core];
|
||||
|
||||
#[legacy_exports];
|
||||
|
||||
#[allow(vecs_implicitly_copyable)];
|
||||
#[deny(non_camel_case_types)];
|
||||
#[forbid(deprecated_pattern)];
|
||||
|
@ -27,77 +25,62 @@ not required in or otherwise suitable for the core library.
|
|||
extern mod core(vers = "0.4");
|
||||
use core::*;
|
||||
|
||||
export net, net_tcp, net_ip, net_url;
|
||||
export uv, uv_ll, uv_iotask, uv_global_loop;
|
||||
export c_vec, timer;
|
||||
export sync, arc, comm;
|
||||
export bitv, deque, fun_treemap, list, map;
|
||||
export smallintmap, sort, treemap;
|
||||
export rope, arena, par;
|
||||
export ebml, ebml2;
|
||||
export dbg, getopts, json, rand, sha1, term, time;
|
||||
export prettyprint, prettyprint2;
|
||||
export test, tempfile, serialization, serialization2;
|
||||
export cmp;
|
||||
export base64;
|
||||
export cell;
|
||||
|
||||
// General io and system-services modules
|
||||
|
||||
mod net;
|
||||
mod net_ip;
|
||||
mod net_tcp;
|
||||
mod net_url;
|
||||
pub mod net;
|
||||
pub mod net_ip;
|
||||
pub mod net_tcp;
|
||||
pub mod net_url;
|
||||
|
||||
// libuv modules
|
||||
mod uv;
|
||||
mod uv_ll;
|
||||
mod uv_iotask;
|
||||
mod uv_global_loop;
|
||||
pub mod uv;
|
||||
pub mod uv_ll;
|
||||
pub mod uv_iotask;
|
||||
pub mod uv_global_loop;
|
||||
|
||||
|
||||
// Utility modules
|
||||
|
||||
mod c_vec;
|
||||
mod timer;
|
||||
mod cell;
|
||||
pub mod c_vec;
|
||||
pub mod timer;
|
||||
pub mod cell;
|
||||
|
||||
// Concurrency
|
||||
|
||||
mod sync;
|
||||
mod arc;
|
||||
mod comm;
|
||||
pub mod sync;
|
||||
pub mod arc;
|
||||
pub mod comm;
|
||||
|
||||
// Collections
|
||||
|
||||
mod bitv;
|
||||
mod deque;
|
||||
mod fun_treemap;
|
||||
mod list;
|
||||
mod map;
|
||||
mod rope;
|
||||
mod smallintmap;
|
||||
mod sort;
|
||||
mod treemap;
|
||||
pub mod bitv;
|
||||
pub mod deque;
|
||||
pub mod fun_treemap;
|
||||
pub mod list;
|
||||
pub mod map;
|
||||
pub mod rope;
|
||||
pub mod smallintmap;
|
||||
pub mod sort;
|
||||
pub mod treemap;
|
||||
|
||||
// And ... other stuff
|
||||
|
||||
mod ebml;
|
||||
mod ebml2;
|
||||
mod dbg;
|
||||
mod getopts;
|
||||
mod json;
|
||||
mod sha1;
|
||||
mod md4;
|
||||
mod tempfile;
|
||||
mod term;
|
||||
mod time;
|
||||
mod prettyprint;
|
||||
mod prettyprint2;
|
||||
mod arena;
|
||||
mod par;
|
||||
mod cmp;
|
||||
mod base64;
|
||||
pub mod ebml;
|
||||
pub mod ebml2;
|
||||
pub mod dbg;
|
||||
pub mod getopts;
|
||||
pub mod json;
|
||||
pub mod sha1;
|
||||
pub mod md4;
|
||||
pub mod tempfile;
|
||||
pub mod term;
|
||||
pub mod time;
|
||||
pub mod prettyprint;
|
||||
pub mod prettyprint2;
|
||||
pub mod arena;
|
||||
pub mod par;
|
||||
pub mod cmp;
|
||||
pub mod base64;
|
||||
|
||||
#[cfg(unicode)]
|
||||
mod unicode;
|
||||
|
@ -105,10 +88,9 @@ mod unicode;
|
|||
|
||||
// Compiler support modules
|
||||
|
||||
mod test;
|
||||
#[legacy_exports]
|
||||
mod serialization;
|
||||
mod serialization2;
|
||||
pub mod test;
|
||||
pub mod serialization;
|
||||
pub mod serialization2;
|
||||
|
||||
// Local Variables:
|
||||
// mode: rust;
|
||||
|
|
Loading…
Reference in New Issue