serialize: Switch field privacy as necessary
This commit is contained in:
parent
e5a49a2fcf
commit
ee7016d95f
@ -20,9 +20,9 @@ use std::str;
|
||||
// Common data structures
|
||||
#[deriving(Clone)]
|
||||
pub struct Doc<'a> {
|
||||
data: &'a [u8],
|
||||
start: uint,
|
||||
end: uint,
|
||||
pub data: &'a [u8],
|
||||
pub start: uint,
|
||||
pub end: uint,
|
||||
}
|
||||
|
||||
impl<'doc> Doc<'doc> {
|
||||
@ -40,8 +40,8 @@ impl<'doc> Doc<'doc> {
|
||||
}
|
||||
|
||||
pub struct TaggedDoc<'a> {
|
||||
priv tag: uint,
|
||||
doc: Doc<'a>,
|
||||
tag: uint,
|
||||
pub doc: Doc<'a>,
|
||||
}
|
||||
|
||||
pub enum EbmlEncoderTag {
|
||||
@ -117,8 +117,8 @@ pub mod reader {
|
||||
)
|
||||
|
||||
pub struct Res {
|
||||
val: uint,
|
||||
next: uint
|
||||
pub val: uint,
|
||||
pub next: uint
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
@ -291,8 +291,8 @@ pub mod reader {
|
||||
pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
|
||||
|
||||
pub struct Decoder<'a> {
|
||||
priv parent: Doc<'a>,
|
||||
priv pos: uint,
|
||||
parent: Doc<'a>,
|
||||
pos: uint,
|
||||
}
|
||||
|
||||
pub fn Decoder<'a>(d: Doc<'a>) -> Decoder<'a> {
|
||||
@ -635,8 +635,8 @@ pub mod writer {
|
||||
|
||||
// ebml writing
|
||||
pub struct Encoder<'a, W> {
|
||||
writer: &'a mut W,
|
||||
priv size_positions: ~[uint],
|
||||
pub writer: &'a mut W,
|
||||
size_positions: ~[uint],
|
||||
}
|
||||
|
||||
fn write_sized_vuint<W: Writer>(w: &mut W, n: uint, size: uint) -> EncodeResult {
|
||||
|
@ -298,7 +298,7 @@ fn spaces(n: uint) -> ~str {
|
||||
|
||||
/// A structure for implementing serialization to JSON.
|
||||
pub struct Encoder<'a> {
|
||||
priv wr: &'a mut io::Writer,
|
||||
wr: &'a mut io::Writer,
|
||||
}
|
||||
|
||||
impl<'a> Encoder<'a> {
|
||||
@ -504,8 +504,8 @@ impl<'a> ::Encoder<io::IoError> for Encoder<'a> {
|
||||
/// Another encoder for JSON, but prints out human-readable JSON instead of
|
||||
/// compact data
|
||||
pub struct PrettyEncoder<'a> {
|
||||
priv wr: &'a mut io::Writer,
|
||||
priv indent: uint,
|
||||
wr: &'a mut io::Writer,
|
||||
indent: uint,
|
||||
}
|
||||
|
||||
impl<'a> PrettyEncoder<'a> {
|
||||
@ -899,10 +899,10 @@ impl Json {
|
||||
}
|
||||
|
||||
pub struct Parser<T> {
|
||||
priv rdr: T,
|
||||
priv ch: Option<char>,
|
||||
priv line: uint,
|
||||
priv col: uint,
|
||||
rdr: T,
|
||||
ch: Option<char>,
|
||||
line: uint,
|
||||
col: uint,
|
||||
}
|
||||
|
||||
impl<T: Iterator<char>> Parser<T> {
|
||||
@ -1298,7 +1298,7 @@ pub fn from_str(s: &str) -> DecodeResult<Json> {
|
||||
|
||||
/// A structure to decode JSON to values in rust.
|
||||
pub struct Decoder {
|
||||
priv stack: ~[Json],
|
||||
stack: ~[Json],
|
||||
}
|
||||
|
||||
impl Decoder {
|
||||
|
Loading…
x
Reference in New Issue
Block a user