commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
0edd2fd07d1f1beaab031f6d6f9c325efeb40117 | Evgeny Safronov | 2015-04-21T18:15:08 | [UT] Minor file moving. | diff --git a/tests/func/int.rs b/tests/func/encode/int.rs
similarity index 100%
rename from tests/func/int.rs
rename to tests/func/encode/int.rs
diff --git a/tests/func/encode/mod.rs b/tests/func/encode/mod.rs
index 5bae29b..6f383ce 100644
--- a/tests/func/encode/mod.rs
+++ b/tests/func/encode/mod.rs
@@ -1 +1,2 @@
mod... | 3 | 1 | 1 |
e67f7b56af0b49b0ff4352e824083966c2884f23 | Evgeny Safronov | 2015-04-21T18:14:13 | [Encode] Use own error enum.
The idea is: do not return variant with impossible values. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 5eaeb72..2a52171 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -722,7 +722,6 @@ impl From<core::Error> for Error {
core::Error::TypeMismatch(marker) => Error::TypeMismatch(marker),
core::Error::InvalidMarkerRead(err) =>... | 9 | 62 | 67 |
52889c60f54b38e5d10046d6aff342b311607694 | Evgeny Safronov | 2015-04-19T21:37:08 | [Encode] Positive fixnum. | diff --git a/src/core/encode.rs b/src/core/encode.rs
index 76ffdd1..b862758 100644
--- a/src/core/encode.rs
+++ b/src/core/encode.rs
@@ -9,6 +9,9 @@ use super::{
Result,
};
+// TODO: Consider own Error/Result types for encode module.
+// Errors: IntegerTooLarge, MarkerWriteError(IO), DataWriteError(IO).
+
fn w... | 4 | 63 | 37 |
8aff7ebb1e61da54fc912cc2c54d244a651b9f86 | Evgeny Safronov | 2015-04-19T21:11:49 | [Misc] Planning. | diff --git a/src/core/mod.rs b/src/core/mod.rs
index 3882690..b850a6d 100644
--- a/src/core/mod.rs
+++ b/src/core/mod.rs
@@ -51,6 +51,7 @@ pub enum Marker {
Reserved,
}
+// TODO: Consider using own trait without Option packing/unpacking.
impl FromPrimitive for Marker {
fn from_i64(n: i64) -> Option<Marker... | 1 | 2 | 0 |
fe9d2d88ce7e51e4ecda8adf4b88b5557a9a1bcb | Evgeny Safronov | 2015-04-19T21:09:26 | [Encode] Use standard library traits.
I give a damn, that To/FromNumeric will likely to be removed. | diff --git a/src/core/encode.rs b/src/core/encode.rs
index b2796df..76ffdd1 100644
--- a/src/core/encode.rs
+++ b/src/core/encode.rs
@@ -1,4 +1,5 @@
use std::io::Write;
+use std::num::ToPrimitive;
use byteorder::{WriteBytesExt};
@@ -6,13 +7,14 @@ use super::{
Error,
Marker,
Result,
- ToByte,
};... | 2 | 51 | 48 |
971180b8cc40ee482d89746d99da2e7cac5e0b96 | Evgeny Safronov | 2015-04-19T20:33:34 | [UT] Naming. | diff --git a/tests/func/null.rs b/tests/func/null.rs
index 416d65b..fa07957 100644
--- a/tests/func/null.rs
+++ b/tests/func/null.rs
@@ -6,7 +6,7 @@ use msgpack::core::decode::*;
use msgpack::core::encode::*;
#[test]
-fn from_nil() {
+fn pass_read_nil() {
let buf: &[u8] = &[0xc0];
let mut cur = Cursor::ne... | 1 | 3 | 3 |
0e73a4dc7feaa1a8a0f79ae2139935974ae26f20 | Evgeny Safronov | 2015-04-19T19:04:58 | [Encode] Handling primitive write errors. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 2a52171..5eaeb72 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -722,6 +722,7 @@ impl From<core::Error> for Error {
core::Error::TypeMismatch(marker) => Error::TypeMismatch(marker),
core::Error::InvalidMarkerRead(err) =>... | 4 | 44 | 3 |
82888b012d999ef97767f6267ec7aa3b033f3257 | Evgeny Safronov | 2015-04-19T18:40:10 | [Encode] Write null. | diff --git a/src/core/encode.rs b/src/core/encode.rs
index e69de29..7aa204a 100644
--- a/src/core/encode.rs
+++ b/src/core/encode.rs
@@ -0,0 +1,26 @@
+use std::io::Write;
+
+use byteorder::{WriteBytesExt};
+
+use super::{
+ Marker,
+ Result,
+ ToByte,
+};
+
+fn write_marker<W>(wr: &mut W, marker: Marker) -> Re... | 3 | 85 | 0 |
0f265cdea442de23da0b945a88cb4dbbbb2f090e | Evgeny Safronov | 2015-04-19T18:39:52 | [Misc] Dead code elimination (already moved). | diff --git a/tests/func/unsorted.rs b/tests/func/unsorted.rs
index eac61b2..8feef33 100644
--- a/tests/func/unsorted.rs
+++ b/tests/func/unsorted.rs
@@ -32,35 +32,6 @@ fn from_bin32_max_read_len() {
assert_eq!(5, cur.position());
}
-#[test]
-fn from_nil() {
- let buf: &[u8] = &[0xc0];
- let mut cur = Curs... | 1 | 0 | 29 |
942ec9b12ee24e3cda6c6705233ae97169fd9bd8 | Evgeny Safronov | 2015-04-19T18:25:33 | [Misc] Cleaning up. | diff --git a/src/core/mod.rs b/src/core/mod.rs
index a366d71..94f9a40 100644
--- a/src/core/mod.rs
+++ b/src/core/mod.rs
@@ -150,7 +150,7 @@ impl convert::From<byteorder::Error> for ReadError {
}
}
-#[unstable(reason = "remove Debug trait; drop MarkerError")]
+#[unstable(reason = "remove Debug trait")]
#[deriv... | 1 | 1 | 1 |
edfc275146a13e6c294ad64b8d903d2c645b036c | Evgeny Safronov | 2015-04-19T18:01:24 | [Decoder] Implement decoder contract. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 46f95cb..2a52171 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -712,6 +712,8 @@ pub enum Error {
InvalidMarkerRead(ReadError),
InvalidDataRead(ReadError),
LengthMismatch(u32),
+ /// Uncategorized error.
+ Uncategorized(String)... | 1 | 5 | 1 |
ef8160e061734cbeccac7e63937168c177c4dfaf | Evgeny Safronov | 2015-04-19T16:47:25 | [Decode] Deserialize maps. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 9603a8a..46f95cb 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -701,6 +701,7 @@ use super::{
read_str_len,
read_str_data,
read_array_size,
+ read_map_size,
};
#[unstable(reason = "docs; incomplete")]
@@ -901,11 +902,24 @@ imp... | 2 | 41 | 5 |
ad3f4fb6b32e4b6ca7db172cf44b9185852083ea | Evgeny Safronov | 2015-04-19T16:38:43 | [Decode] Deserialize sequences. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 7cce9f5..9603a8a 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -862,7 +862,7 @@ impl<R: Read> serialize::Decoder for Decoder<R> {
}
}
- // We don't care about index argument.
+ // In case of MessagePack don't care about argum... | 2 | 23 | 4 |
a4c357cb312da0a3f8fb758dc9f61e1d02639d2c | Evgeny Safronov | 2015-04-19T16:15:27 | [Misc] Minor comments. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 2485a49..7cce9f5 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -874,9 +874,11 @@ impl<R: Read> serialize::Decoder for Decoder<R> {
fn read_tuple_struct_arg<T, F>(&mut self, a_idx: usize, f: F) -> Result<T>
where F: FnOnce(&mut Self) ... | 1 | 2 | 0 |
1e9836eef7021a72c084ace569dcb8630d1a2ec7 | Evgeny Safronov | 2015-04-19T16:15:16 | [UT] Additional test cases for deserializing. | diff --git a/tests/func/decoder.rs b/tests/func/decoder.rs
index 860c549..6c25f0e 100644
--- a/tests/func/decoder.rs
+++ b/tests/func/decoder.rs
@@ -297,6 +297,16 @@ mod unspecified {
assert_eq!(Some(31), actual);
}
+ #[test]
+ fn pass_option_some_null() {
+ let buf = [0xc0];
+ let c... | 1 | 20 | 0 |
56dbbe7572a126d64e8f4a6f8ce45a0432f24bad | Evgeny Safronov | 2015-04-19T16:04:26 | [Decode] Deserializing options. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index bb43c4e..2485a49 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -874,8 +874,15 @@ impl<R: Read> serialize::Decoder for Decoder<R> {
fn read_tuple_struct_arg<T, F>(&mut self, a_idx: usize, f: F) -> Result<T>
where F: FnOnce(&mut Self) ... | 1 | 9 | 2 |
832ad74b20759d4b8d86279178a662f21983a8e0 | Evgeny Safronov | 2015-04-19T16:04:15 | [Decode] Extending TypeMismatch error.
TypeMismatch error now carries the actual type. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 72e965d..bb43c4e 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -16,7 +16,7 @@ fn read_marker<R>(rd: &mut R) -> Result<Marker>
Ok(val) => {
match FromPrimitive::from_u8(val) {
Some(marker) => Ok(marker),
- ... | 4 | 58 | 54 |
b65c1d51e4f1a2760af5d80b328839eaed990fd6 | Evgeny Safronov | 2015-04-19T16:01:10 | [Core] Exporting marker enum. | diff --git a/src/core/mod.rs b/src/core/mod.rs
index 8649953..5a66332 100644
--- a/src/core/mod.rs
+++ b/src/core/mod.rs
@@ -10,7 +10,8 @@ const FIXSTR_SIZE : u8 = 0x1f;
const FIXARRAY_SIZE : u8 = 0x0f;
const FIXMAP_SIZE : u8 = 0x0f;
-enum Marker {
+#[derive(Debug, PartialEq)]
+pub enum Marker {
PositiveFi... | 2 | 6 | 1 |
12fbaf8b7598810c8a26a40edd92c51ecbb003a6 | Evgeny Safronov | 2015-04-19T16:00:49 | [UT] Added option decoding tests (fails now). | diff --git a/tests/func/decoder.rs b/tests/func/decoder.rs
index fa20185..c056948 100644
--- a/tests/func/decoder.rs
+++ b/tests/func/decoder.rs
@@ -283,4 +283,24 @@ mod unspecified {
assert_eq!(Decoded { id: 42, value: 100500 }, actual);
}
+
+ #[test]
+ fn pass_option_some() {
+ let buf = ... | 1 | 20 | 0 |
1d299d014f270e61b58595c0f6e16282b05c935d | Evgeny Safronov | 2015-04-19T11:26:20 | [Decode] Deserialize structs. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 7101e79..72e965d 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -838,10 +838,17 @@ impl<R: Read> serialize::Decoder for Decoder<R> {
fn read_enum_struct_variant_field<T, F>(&mut self, f_name: &str, f_idx: usize, f: F) -> Result<T>
whe... | 3 | 45 | 10 |
8e12a4a90c69a17c30dd974296c10c990a497c31 | Evgeny Safronov | 2015-04-17T03:27:51 | [Decode] Deserialize tuples. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 2850bda..7101e79 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -700,14 +700,17 @@ use super::{
read_f64,
read_str_len,
read_str_data,
+ read_array_size,
};
+#[unstable(reason = "docs; incomplete")]
#[derive(Debug, PartialEq)]... | 2 | 45 | 3 |
56f14704cb3286dbc436c0a7928ed30ab4144b46 | Evgeny Safronov | 2015-04-17T03:06:06 | [Decode] Deserialize string. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 5540792..2850bda 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -698,6 +698,8 @@ use super::{
read_i64_loosely,
read_f32,
read_f64,
+ read_str_len,
+ read_str_data,
};
#[derive(Debug, PartialEq)]
@@ -718,6 +720,17 @@ impl F... | 2 | 32 | 1 |
f730059b5bbb49ac39a32a6bdbcaed48d1b6725f | Evgeny Safronov | 2015-04-16T21:39:01 | [Decode] Deserialize f32/64. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index df82698..5540792 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -696,6 +696,8 @@ use super::{
read_i16_loosely,
read_i32_loosely,
read_i64_loosely,
+ read_f32,
+ read_f64,
};
#[derive(Debug, PartialEq)]
@@ -788,8 +790,13 @@... | 3 | 29 | 7 |
2522e5faa6a029659031f9f9891490dd02ba763a | Evgeny Safronov | 2015-04-15T08:17:56 | [Decode] Finished with deserializing integers. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index f4a19f3..df82698 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -241,6 +241,42 @@ pub fn read_u64_loosely<R>(rd: &mut R) -> Result<u64>
}
}
+#[unstable(reason = "not sure about name; docs; untested")]
+pub fn read_i8_loosely<R>(rd: &mut R) ... | 2 | 113 | 7 |
a43bef2bb25fcb990d3084060089a0190ebdfacf | Evgeny Safronov | 2015-04-14T20:09:29 | [Decode] Deserialize usize. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 34ea986..f4a19f3 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -642,6 +642,7 @@ pub mod serialize {
use std::convert::From;
use std::io::Read;
+use std::num;
use std::result;
use serialize;
@@ -717,7 +718,13 @@ impl<R: Read> serialize::Dec... | 2 | 18 | 1 |
b348c3ef9a478abce1bdfd3ca4ee10ddb465d466 | Evgeny Safronov | 2015-04-14T20:06:52 | [Decode] Deserialize u8. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index ebef19f..34ea986 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -187,7 +187,18 @@ make_read_data_fn!(i64, read_data_i64, read_i64);
make_read_data_fn!(f32, read_data_f32, read_f32);
make_read_data_fn!(f64, read_data_f64, read_f64);
-#[unstable(... | 2 | 33 | 9 |
5fb755230f38345a9d68705374b4044d86c2e3d5 | Evgeny Safronov | 2015-04-14T20:04:21 | [Decode] Deserialize u16. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 5c81cc5..ebef19f 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -187,6 +187,18 @@ make_read_data_fn!(i64, read_data_i64, read_i64);
make_read_data_fn!(f32, read_data_f32, read_f32);
make_read_data_fn!(f64, read_data_f64, read_f64);
+#[unstable(... | 1 | 14 | 6 |
1759263955137484a26265e7e38099dce9b11e47 | Evgeny Safronov | 2015-04-14T20:03:20 | [Decode] Deserializing u32. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 93062f0..5c81cc5 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -187,6 +187,19 @@ make_read_data_fn!(i64, read_data_i64, read_i64);
make_read_data_fn!(f32, read_data_f32, read_f32);
make_read_data_fn!(f64, read_data_f64, read_f64);
+#[unstable(... | 2 | 47 | 5 |
c0ff9e3eb272fbabd6f35707a01ef63cf623f6ee | Evgeny Safronov | 2015-04-13T21:45:13 | [Decode] Deserialize from u32. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index cd246ca..93062f0 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -606,6 +606,7 @@ pub mod serialize {
use std::convert::From;
use std::io::Read;
+use std::num;
use std::result;
use serialize;
@@ -664,7 +665,14 @@ impl<R: Read> serialize::Dec... | 2 | 19 | 1 |
29108a90231b18c32d1f4764488dbeb42e0791a7 | Evgeny Safronov | 2015-04-13T21:38:57 | [Decode] Drop MarkerError.
Because there is only a single value (0xc1) for entire byte range that is unassigned. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 209c824..cd246ca 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -7,7 +7,7 @@ use std::str::from_utf8;
use byteorder::{self, ReadBytesExt};
-use super::{Marker, Error, MarkerError, ReadError, Result, Integer, DecodeStringError};
+use super::{Ma... | 4 | 48 | 52 |
38502da0e68bd5d943eb360ec991f42ded24992e | Evgeny Safronov | 2015-04-13T21:32:21 | [Decode] Refactoring. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index ea1402e..209c824 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -611,9 +611,10 @@ use std::result;
use serialize;
use super::super::super::core;
-use super::super::{Marker, ReadError};
+use super::super::ReadError;
use super::{
- read_marke... | 1 | 5 | 11 |
b82ca25871f040ca6c068292ae63fb1b00484f7b | Evgeny Safronov | 2015-04-13T21:31:01 | [Misc] Wording. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 6da62fb..ea1402e 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -619,7 +619,7 @@ use super::{
#[derive(Debug, PartialEq)]
pub enum Error {
- /// The actual value type isn't equal with the given one.
+ /// The actual value type isn't equal... | 1 | 1 | 1 |
7eaf2aa0aaf7be9fc2c8bb02957f6faf43f7739d | Evgeny Safronov | 2015-04-13T21:30:29 | [Misc] Error reorganization. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 94fb9ee..6da62fb 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -287,7 +287,7 @@ pub fn read_str<'r, R>(rd: &mut R, mut buf: &'r mut [u8]) -> result::Result<&'r
let ulen = len as usize;
if buf.len() < ulen {
- return Err(DecodeSt... | 3 | 7 | 10 |
80a96d97a73a975d62aee631df3ce09d30760ebe | Evgeny Safronov | 2015-04-13T21:20:56 | [Decode] Deserializing u64. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index f7eb3ec..94fb9ee 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -610,18 +610,28 @@ use std::result;
use serialize;
use super::super::super::core;
-use super::super::Marker;
-use super::read_marker;
+use super::super::{Marker, ReadError};
+use s... | 3 | 82 | 22 |
98fa66a265589f1354806be9f277f79076222e51 | Evgeny Safronov | 2015-04-13T20:11:53 | [Decode] Deserialize bool. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 43f6941..f7eb3ec 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -663,8 +663,9 @@ impl<R: Read> serialize::Decoder for Decoder<R> {
fn read_bool(&mut self) -> Result<bool> {
match try!(read_marker(&mut self.rd)) {
+ Marker... | 2 | 28 | 3 |
a10f7af760aede580b32cba084cb776e229bce4f | Evgeny Safronov | 2015-04-12T19:51:02 | [Decode] Deserialize boolean (false) value. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 8d673ef..43f6941 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -660,7 +660,14 @@ impl<R: Read> serialize::Decoder for Decoder<R> {
fn read_i32(&mut self) -> Result<i32> { unimplemented!() }
fn read_i16(&mut self) -> Result<i16> { unimple... | 2 | 26 | 1 |
adfbdf735cb0668eabb980a4184bc24c80900f90 | Evgeny Safronov | 2015-04-11T21:24:31 | [Decode] Deserialize from null: error handling. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index b6b4926..8d673ef 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -603,15 +603,27 @@ pub fn read_value<R>(rd: &mut R) -> Result<Value>
pub mod serialize {
+use std::convert::From;
use std::io::Read;
use std::result;
use serialize;
+use su... | 2 | 49 | 12 |
7b234a310d825aa6b1f16eee0116308c62b7a4a7 | Evgeny Safronov | 2015-04-11T21:10:39 | [Misc] Fixed doc style. | diff --git a/src/lib.rs b/src/lib.rs
index e57adf5..a003e6a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -27,9 +27,9 @@ pub use core::{Error, ReadError, MarkerError};
#[cfg(test)]
mod bench;
-/// Stage 1. Low-level decoding functions.
-/// Stage 2. Value decoding functions.
-/// Stage 3. Deserialization.
-/// Stage ... | 1 | 6 | 6 |
ff56bd1e78f1101921ff043c52ef0b30b88cca91 | Evgeny Safronov | 2015-04-11T19:48:43 | [Misc] Planning. | diff --git a/src/lib.rs b/src/lib.rs
index 08ba413..e57adf5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,3 +26,10 @@ pub use core::{Error, ReadError, MarkerError};
#[cfg(test)]
mod bench;
+
+/// Stage 1. Low-level decoding functions.
+/// Stage 2. Value decoding functions.
+/// Stage 3. Deserialization.
+/// Sta... | 1 | 7 | 0 |
577e2db5e32091d7a6d211e79125ceaf48f61e2b | Evgeny Safronov | 2015-04-11T18:01:55 | [Decode] Deserialize from null. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 6ac0d7b..b6b4926 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -608,9 +608,10 @@ use std::result;
use serialize;
-pub enum Error {
- None,
-}
+use super::super::Marker;
+use super::read_marker;
+
+use super::value::Error;
pub type Resul... | 1 | 10 | 4 |
9a92cf58879a58f616a4a7d5966941c3ea37bb2f | Evgeny Safronov | 2015-04-09T21:18:30 | [Decode] Deserialize, part 1. | diff --git a/Cargo.lock b/Cargo.lock
index a0df068..bd59a15 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3,6 +3,7 @@ name = "msgpack"
version = "0.1.0-rc1"
dependencies = [
"byteorder 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.3.12 (registry+https://github.com/rust-lang/cra... | 7 | 98 | 0 |
1bfdaf582c645a197339c7a584ab187b532b5ee6 | Evgeny Safronov | 2015-04-07T23:04:27 | [Misc] Remove debug info. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 150fcae..862c47d 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -587,14 +587,13 @@ pub fn read_value<R>(rd: &mut R) -> Result<Value>
Marker::FixedArray(len) => {
let mut vec = Vec::with_capacity(len as usize);
- f... | 1 | 2 | 3 |
0253af6b0a18480c0029643e4c1a1d9c521662c7 | Evgeny Safronov | 2015-04-07T22:58:57 | [Decode] Value from array. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index d7c1f57..150fcae 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -571,6 +571,7 @@ pub fn read_value<R>(rd: &mut R) -> Result<Value>
{
match try!(read_marker(rd)) {
Marker::Null => Ok(Value::Null),
+ Marker::PositiveFixnum(v) =>... | 3 | 32 | 0 |
2b5de26e1645c85aa8dc073d036044a3026c8509 | Evgeny Safronov | 2015-04-07T22:58:39 | [Doc] More docs. | diff --git a/src/core/mod.rs b/src/core/mod.rs
index 8773b4d..87f5f3b 100644
--- a/src/core/mod.rs
+++ b/src/core/mod.rs
@@ -185,7 +185,9 @@ pub type Result<T> = result::Result<T, Error>;
#[derive(Clone, Debug, PartialEq)]
pub enum Integer {
+ /// Every non-negative integer is treated as u64, even if it fits in ... | 1 | 2 | 0 |
f2a1b56d1b4caefa2aa4b217f677a56be4c7349c | Evgeny Safronov | 2015-04-07T22:30:06 | [Misc] Benchmark decomposition. | diff --git a/src/bench.rs b/src/bench.rs
new file mode 100644
index 0000000..e3bb99d
--- /dev/null
+++ b/src/bench.rs
@@ -0,0 +1,44 @@
+extern crate test;
+
+use super::core::decode::*;
+use self::test::Bencher;
+
+#[bench]
+fn from_i64_read_i64_loosely(b: &mut Bencher) {
+ let buf = [0xd3, 0x7f, 0xff, 0xff, 0xff, 0... | 3 | 47 | 51 |
556f825884daadd34813b2bd9c3e0e5958e1b6ad | Evgeny Safronov | 2015-04-07T22:25:35 | [Decode] Code reuse. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 3631d05..43f3177 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -536,8 +536,8 @@ use std::io::Read;
use std::result;
use std::str::Utf8Error;
-use super::{read_marker, read_data_u8, read_data_i32};
-use super::super::{Marker, Value, Integer, Re... | 2 | 23 | 16 |
896e4405b1462e065acc091ca957f36ea6353e09 | Evgeny Safronov | 2015-04-07T22:06:10 | [Misc] Code style. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index ffddda2..3631d05 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -293,7 +293,8 @@ pub fn read_str<'r, R>(rd: &mut R, mut buf: &'r mut [u8]) -> result::Result<&'r
read_str_data(rd, len, &mut buf[0..ulen])
}
-fn read_str_data<'r, R>(rd: &mut R... | 1 | 3 | 1 |
b2ff8feff9950335ffce927f13a52c8549e0b421 | Evgeny Safronov | 2015-04-07T22:03:28 | [Decode] Implemented borrowed errors. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 9f9fe03..ffddda2 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -2,11 +2,12 @@ use std::convert::From;
use std::io;
use std::io::{Cursor, Read};
use std::num::FromPrimitive;
+use std::result;
use std::str::from_utf8;
use byteorder::{self, Re... | 3 | 33 | 12 |
bc460a00c1870f96817aa8846f7b7401da47b3ba | Evgeny Safronov | 2015-04-07T21:33:13 | [Decode] Decoding null value. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 6c30790..9f9fe03 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -552,6 +552,7 @@ pub fn read_value<R>(rd: &mut R) -> Result<Value>
where R: Read
{
match try!(read_marker(rd)) {
+ Marker::Null => Ok(Value::Null),
Marker::I... | 3 | 11 | 0 |
d28da511f7874df0cfeec03976c77727bf062c61 | Evgeny Safronov | 2015-04-07T21:29:50 | [Bug Fix] Properly copy bytes from reader. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 4e3a76b..6c30790 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -1,6 +1,6 @@
use std::convert::From;
use std::io;
-use std::io::Read;
+use std::io::{Cursor, Read};
use std::num::FromPrimitive;
use std::str::from_utf8;
@@ -283,14 +283,27 @@ pu... | 1 | 19 | 4 |
a74622a880befd560537346ee9f5c894167964d1 | Evgeny Safronov | 2015-04-07T19:15:07 | [Decode] Handling UTF-8 error from value. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 0a47fd1..4e3a76b 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -546,7 +546,13 @@ pub fn read_value<R>(rd: &mut R) -> Result<Value>
// TODO: Use core function, passing buf as slice.
match io::copy(&mut rd.take(len), &mut b... | 2 | 19 | 1 |
138152e1cabdd213221c71064c412671df25827e | Evgeny Safronov | 2015-04-05T21:48:30 | [CC] Drop useless macro now. | diff --git a/tests/func/macros.rs b/tests/func/macros.rs
deleted file mode 100644
index cd9d678..0000000
--- a/tests/func/macros.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Hack, because of PartialEq trait removal from io::Error.
-#[macro_export]
-macro_rules! assert_err {
- ($expected:pat, $actual:expr) => ({
- ma... | 2 | 0 | 13 |
1ef602de97baa6987594070f135eb269ca37cf5b | Evgeny Safronov | 2015-04-05T21:47:35 | [Decode] Decoding string value with EOF.
Also all errors are not comparable again. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 1316a84..0a47fd1 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -6,7 +6,7 @@ use std::str::from_utf8;
use byteorder::{self, ReadBytesExt};
-use super::{Marker, Error, MarkerError, ReadError, Result, Integer, Value};
+use super::{Marker, Error,... | 6 | 176 | 99 |
3be77a1ede56ee1e32f247e1245dc7a6fbfc35e3 | Evgeny Safronov | 2015-04-05T19:47:02 | [Decode] Documenting string decoding function. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index fa522be..1316a84 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -256,8 +256,29 @@ pub fn read_str_len<R>(rd: &mut R) -> Result<u32>
/// Tries to read a string data from the reader and copy it to the buffer provided.
///
-/// According to the sp... | 1 | 23 | 2 |
3e15224c367cd9c6c30e453f8f0ef961b421b009 | Evgeny Safronov | 2015-04-05T15:24:52 | [Dev] Move value into the root module. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index 499530c..ea5660b 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -6,7 +6,7 @@ use std::str::from_utf8;
use byteorder::{self, ReadBytesExt};
-use super::{Marker, Error, MarkerError, ReadError, Result};
+use super::{Marker, Error, MarkerError, Re... | 2 | 19 | 18 |
3f001498b804887e2569d3ebc0e851e879da6563 | Evgeny Safronov | 2015-04-04T17:06:29 | [Version] Bumped. | diff --git a/Cargo.lock b/Cargo.lock
index 09cac39..a0df068 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
[root]
name = "msgpack"
-version = "0.1.0"
+version = "0.1.0-rc1"
dependencies = [
"byteorder 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
diff --git a/Cargo.toml b/Cargo.toml
... | 2 | 2 | 2 |
afe6abdfcf23672c8e6ab6bceef15b251b4c0337 | Evgeny Safronov | 2015-04-04T17:02:52 | [Decode] Zero-copy binary decoding.
Closes #5. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index c30ebdf..499530c 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -373,6 +373,20 @@ pub fn read_bin_len<R>(rd: &mut R) -> Result<u32>
}
}
+#[unstable(reason = "docs; not sure about naming")]
+pub fn read_bin_borrow(rd: &[u8]) -> Result<&[u8]>... | 2 | 30 | 3 |
3b055d354478dac9949dac4dfe02e758bf481151 | Evgeny Safronov | 2015-04-04T16:13:50 | [Misc] Module decomposition.
Closes #2. | diff --git a/src/core/encode.rs b/src/core/encode.rs
new file mode 100644
index 0000000..e69de29
diff --git a/src/high/decode.rs b/src/high/decode.rs
new file mode 100644
index 0000000..e69de29
diff --git a/src/high/encode.rs b/src/high/encode.rs
new file mode 100644
index 0000000..e69de29
diff --git a/src/high/mod.rs ... | 4 | 0 | 0 |
df15b8eca0347037899e5ba1ebd1b005f0f7ade2 | Evgeny Safronov | 2015-04-04T16:10:33 | [Decode] Documenting integer decoding functions.
Closes #1. | diff --git a/src/core/decode.rs b/src/core/decode.rs
index d89e5ec..c30ebdf 100644
--- a/src/core/decode.rs
+++ b/src/core/decode.rs
@@ -68,6 +68,7 @@ pub fn read_nfix<R>(rd: &mut R) -> Result<i8>
}
/// Tries to read strictly i8 value from the reader.
+#[stable(since = "0.1.0")]
pub fn read_i8<R>(rd: &mut R) -> Re... | 1 | 14 | 7 |
10f07c310fae48f1c07601f47254e31c3e99aff5 | Evgeny Safronov | 2015-04-04T11:25:40 | [Dev] Make it compilable with Rust nightly. | diff --git a/Cargo.lock b/Cargo.lock
index 85d7870..09cac39 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,11 +2,11 @@
name = "msgpack"
version = "0.1.0"
dependencies = [
- "byteorder 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 0.3.5 (registry+https://github.com/rust-lang/crates.io-i... | 5 | 83 | 73 |
ef9a401a082a23b956bd0a5a90c61f4dfc4a0a0d | Evgeny Safronov | 2015-04-02T21:58:46 | [Dev] Module decomposition, part 1. | diff --git a/src/decode.rs b/src/core/decode.rs
similarity index 91%
rename from src/decode.rs
rename to src/core/decode.rs
index 34d2484..14ccc37 100644
--- a/src/decode.rs
+++ b/src/core/decode.rs
@@ -1,156 +1,12 @@
-use std::num::FromPrimitive;
use std::error;
use std::io;
use std::io::Read;
-use std::result;
-us... | 5 | 220 | 210 |
a3076303f9d22b641c83cfa52a3a32817c2a772b | Evgeny Safronov | 2015-04-02T21:32:44 | [Decode] Decoding u16/32/64. | diff --git a/src/decode.rs b/src/decode.rs
index 5053048..34d2484 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -262,16 +262,34 @@ pub fn read_u8<R>(rd: &mut R) -> Result<u8>
}
}
+#[unstable(reason = "docs")]
pub fn read_u16<R>(rd: &mut R) -> Result<u16>
where R: Read
{
- unimplemented!()
+ mat... | 1 | 38 | 2 |
ef9a401c8eb63f91db5eca90229876b01eb3392e | Evgeny Safronov | 2015-03-31T20:21:57 | [Decode] Decoding UTF8 string. | diff --git a/src/decode.rs b/src/decode.rs
index 0cbe2ac..5053048 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -3,6 +3,7 @@ use std::error;
use std::io;
use std::io::Read;
use std::result;
+use std::str::{from_utf8, Utf8Error};
use byteorder::{self, ReadBytesExt};
@@ -139,11 +140,14 @@ pub enum MarkerError... | 1 | 65 | 10 |
ac6c6cdae9c848959d0ac86074303cbeb98453bd | Evgeny Safronov | 2015-03-30T21:25:41 | [Dev] Refactoring. | diff --git a/src/decode.rs b/src/decode.rs
index b1e5439..0cbe2ac 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -134,7 +134,7 @@ impl error::FromError<byteorder::Error> for ReadError {
#[derive(PartialEq, Debug)]
pub enum MarkerError {
- TypeMismatch,
+ TypeMismatch, // TODO: Consider saving actual marker... | 1 | 8 | 24 |
37f913d4a2d1ffb86f802d4b3a7b872eb9647e54 | Evgeny Safronov | 2015-03-30T16:41:12 | [Decode] Decoding from u8 strictly. | diff --git a/src/decode.rs b/src/decode.rs
index 638793f..b1e5439 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -247,10 +247,15 @@ pub fn read_i64<R>(rd: &mut R) -> Result<i64>
}
}
+/// Tries to read exactly 2 bytes from the reader and decode them as u8.
+#[stable(since = "0.1.0")]
pub fn read_u8<R>(rd: &m... | 1 | 60 | 1 |
ea5aabd0f35550eb292aeb73f36a11ba368bdb0b | Evgeny Safronov | 2015-03-30T14:16:59 | [Decode] Decoding an UTF8 string. | diff --git a/src/decode.rs b/src/decode.rs
index 51cfe58..638793f 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -310,6 +310,7 @@ pub enum Float {
#[derive(Clone, Debug, PartialEq)]
pub enum Value {
Integer(Integer),
+ String(String),
}
/// Tries to read up to 9 bytes from the reader (1 for marker and ... | 1 | 34 | 1 |
782808e83be85691082014cef60f4a67a9fc1500 | Evgeny Safronov | 2015-03-30T13:22:33 | [Dev] Naming.
Functions that reads signed/unsigned integers are renamed to read_i64_loosely and read_u64_loosely respectively. The performance at least the same as more strict variants `read_*`, but they are more convenient. | diff --git a/src/decode.rs b/src/decode.rs
index 29592eb..51cfe58 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -265,24 +265,6 @@ pub fn read_u32<R>(rd: &mut R) -> Result<u32>
unimplemented!()
}
-// TODO: read_signed_integer not strictly.
-// TODO: read_unsigned_integer not strictly.
-// TODO: high::read_in... | 1 | 84 | 75 |
71e8657f84f80e54d86108b23f45e756750d9ae9 | Evgeny Safronov | 2015-03-30T12:48:17 | [Dev] Renaming. | diff --git a/src/low.rs b/src/decode.rs
similarity index 97%
rename from src/low.rs
rename to src/decode.rs
index 331bdde..29592eb 100644
--- a/src/low.rs
+++ b/src/decode.rs
@@ -247,38 +247,39 @@ pub fn read_i64<R>(rd: &mut R) -> Result<i64>
}
}
+pub fn read_u8<R>(rd: &mut R) -> Result<u8>
+ where R: Read
+... | 3 | 58 | 36 |
1d157f0a0ef53772c872299210b2e99bf4d0fd01 | Evgeny Safronov | 2015-03-29T22:34:56 | [Dev] Review. | diff --git a/src/low.rs b/src/low.rs
index bed33d6..331bdde 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -162,47 +162,48 @@ fn read_marker<R>(rd: &mut R) -> Result<Marker>
}
}
-/// Tries to read nil value from the reader.
+/// Tries to decode a nil value from the reader.
+#[stable(since = "0.1.0")]
pub fn read_... | 1 | 13 | 12 |
33deb01563df1aa8cc6c183b6e58c97563520156 | Evgeny Safronov | 2015-03-29T21:22:24 | [Dev] Optimizing benchmarks. | diff --git a/src/low.rs b/src/low.rs
index 511ec86..bed33d6 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -1227,24 +1227,20 @@ fn from_i64_max_read_integer() {
#[bench]
fn from_i64_read_integer(b: &mut Bencher) {
- let buf: &[u8] = &[0xd3, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff];
+ let buf = [0xd3, 0x7f... | 1 | 4 | 8 |
3093bb4efd750bac60b70d0833fd2633e467622e | Evgeny Safronov | 2015-03-29T20:58:30 | [Dev] Code reducing via macro, part 2. | diff --git a/src/low.rs b/src/low.rs
index 49f9612..511ec86 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -281,41 +281,31 @@ pub fn read_u64<R>(rd: &mut R) -> Result<u64>
}
}
-/// Tries to read exactly 1 byte from the reader and interpret it as an i8.
-fn read_data_i8<R>(rd: &mut R) -> Result<i8>
- where R: Re... | 1 | 12 | 22 |
af83289dbdc0f979171b8d1b6ac93c576928eeaf | Evgeny Safronov | 2015-03-29T20:31:26 | [Dev] Slightly code reducing using macro.
Don't sure it's a good idea. | diff --git a/src/low.rs b/src/low.rs
index 3cbbbde..49f9612 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -291,36 +291,6 @@ fn read_data_i8<R>(rd: &mut R) -> Result<i8>
}
}
-/// Tries to read exactly 2 bytes from the reader and interpret them as a big-endian i16.
-fn read_data_i16<R>(rd: &mut R) -> Result<i16>
- ... | 1 | 18 | 71 |
dfcc6571c77ac6dcd51887934806dbb3d669e7bc | Evgeny Safronov | 2015-03-29T18:33:42 | [CS] Moving code. | diff --git a/src/low.rs b/src/low.rs
index 9406b7e..3cbbbde 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -321,6 +321,60 @@ fn read_data_i64<R>(rd: &mut R) -> Result<i64>
}
}
+fn read_data_u8<R>(rd: &mut R) -> Result<u8>
+ where R: Read
+{
+ match rd.read_u8() {
+ Ok(data) => Ok(data),
+ Err(e... | 1 | 54 | 54 |
0219ffa5a60e6a4b0d7ab99a927fc4cc6e57884d | Evgeny Safronov | 2015-03-29T18:32:25 | [Dev] Some benchmarks added. | diff --git a/src/lib.rs b/src/lib.rs
index e7a3015..df3eef6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,6 +4,7 @@
#![feature(core)]
#![feature(io)]
+#![cfg_attr(test, feature(test))]
extern crate byteorder;
diff --git a/src/low.rs b/src/low.rs
index 2b89c31..9406b7e 100644
--- a/src/low.rs
+++ b/src/low.rs
... | 2 | 52 | 0 |
d4d3fb5b45464471dcff6dcbfd90cf8002a26d1b | Evgeny Safronov | 2015-03-29T17:50:48 | [Dev] Renaming. | diff --git a/src/low.rs b/src/low.rs
index e8dcae0..2b89c31 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -211,7 +211,7 @@ pub fn read_i8<R>(rd: &mut R) -> Result<i8>
where R: Read
{
match try!(read_marker(rd)) {
- Marker::I8 => Ok(try!(read_i8_data(rd))),
+ Marker::I8 => Ok(try!(read_data_i8(rd)... | 1 | 16 | 25 |
75d8f33347faa1ee740000334cab57cfb7bf8335 | Evgeny Safronov | 2015-03-29T17:39:58 | [Decoding] A value from i32. | diff --git a/src/low.rs b/src/low.rs
index bb91611..e8dcae0 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -321,6 +321,7 @@ fn read_i64_data<R>(rd: &mut R) -> Result<i64>
}
}
+#[derive(Clone, Debug, PartialEq)]
pub enum Integer {
U64(u64),
I64(i64),
@@ -331,10 +332,9 @@ pub enum Float {
F64(f64),
... | 1 | 20 | 2 |
8c1e4e04905669c2c905b448608b8df0070d6dd1 | Evgeny Safronov | 2015-03-29T17:39:40 | [Dev] Use std::result module. | diff --git a/src/low.rs b/src/low.rs
index aafcabf..bb91611 100644
--- a/src/low.rs
+++ b/src/low.rs
@@ -1,8 +1,8 @@
-use std; // For std::result, use std::result instead.
use std::num::FromPrimitive;
use std::error;
use std::io;
use std::io::Read;
+use std::result;
use byteorder::{self, ReadBytesExt};
@@ -146... | 1 | 2 | 2 |
51652e414c0fcc0205e88ef306da3a7a9df4fb92 | Evgeny Safronov | 2015-03-29T09:50:38 | [Dev] Simplified decoding meta info from ext. | diff --git a/src/lib.rs b/src/lib.rs
index ddddda8..5c4fefb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -634,50 +634,21 @@ pub struct ExtMeta {
pub fn read_ext_meta<R>(rd: &mut R) -> Result<ExtMeta>
where R: Read
{
- let meta = match try!(read_marker(rd)) {
- Marker::FixExt1 => {
- let size ... | 1 | 12 | 41 |
48da0aa066eb4dd0f06e7525d43341f0be923a93 | Evgeny Safronov | 2015-03-29T09:47:45 | [Decode] Decoding meta info from fixext1/2/4/8/16. | diff --git a/src/lib.rs b/src/lib.rs
index 48a39db..ddddda8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -630,11 +630,36 @@ pub struct ExtMeta {
size: u32,
}
-#[unstable = "docs, errors, from fixext1/2/4/8/16"]
+#[unstable = "docs, errors"]
pub fn read_ext_meta<R>(rd: &mut R) -> Result<ExtMeta>
where R: Re... | 1 | 71 | 1 |
820d0fb9e90533d7154909011e9ffc8a8ac42aec | Evgeny Safronov | 2015-03-29T09:47:25 | [Dev] Update Rust. | diff --git a/Cargo.lock b/Cargo.lock
index 4f74238..85d7870 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,19 +2,11 @@
name = "msgpack"
version = "0.1.0"
dependencies = [
- "byteorder 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 0.3.3 (registry+https://github.com/rust-lang/crates.io-i... | 2 | 4 | 12 |
e57fb8c5da7effa547dca28bfcc14cc4ca4b0da8 | Evgeny Safronov | 2015-03-25T21:44:52 | [Decode] Decoding ext8/16/32 meta data. | diff --git a/src/lib.rs b/src/lib.rs
index e886f8d..0755cda 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -50,6 +50,9 @@ enum Marker {
FixExt4,
FixExt8,
FixExt16,
+ Ext8,
+ Ext16,
+ Ext32,
}
impl FromPrimitive for Marker {
@@ -71,6 +74,9 @@ impl FromPrimitive for Marker {
0xc4 => ... | 1 | 65 | 3 |
e079db5d008176db106ab58e11203b28319fe981 | Evgeny Safronov | 2015-03-25T21:07:31 | [Decode] Decoding fixext8/16. | diff --git a/src/lib.rs b/src/lib.rs
index 793bd07..e886f8d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -48,6 +48,8 @@ enum Marker {
FixExt1,
FixExt2,
FixExt4,
+ FixExt8,
+ FixExt16,
}
impl FromPrimitive for Marker {
@@ -82,8 +84,8 @@ impl FromPrimitive for Marker {
0xd4 => Some(Ma... | 1 | 63 | 2 |
9199a1cb449930dc27063316e79870537ed8c508 | Evgeny Safronov | 2015-03-25T08:20:27 | [CS] Indents. | diff --git a/src/lib.rs b/src/lib.rs
index 6d030c4..793bd07 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -570,7 +570,7 @@ pub fn read_fixext4<R>(rd: &mut R) -> Result<(i8, [u8; 4])>
match try!(read_marker(rd)) {
Marker::FixExt4 => {
- let id = try!(read_data_i8(rd));
+ let id = tr... | 1 | 1 | 1 |
3ab8094220a835935eacfc16c3c9438278347ae2 | Evgeny Safronov | 2015-03-25T08:19:32 | [Decode] Decoding fixext2/4. | diff --git a/src/lib.rs b/src/lib.rs
index 52d83bd..6d030c4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -46,6 +46,8 @@ enum Marker {
Map16,
Map32,
FixExt1,
+ FixExt2,
+ FixExt4,
}
impl FromPrimitive for Marker {
@@ -78,7 +80,13 @@ impl FromPrimitive for Marker {
0xd2 => Some(Marker... | 1 | 68 | 6 |
3d4970e224c7f3706d657ee7c3e92a4692187f1e | Evgeny Safronov | 2015-03-24T08:22:58 | [Decode] Decoding bin8/16/32 and fixext1. | diff --git a/src/lib.rs b/src/lib.rs
index 645b0b6..52d83bd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -36,12 +36,16 @@ enum Marker {
Str8,
Str16,
Str32,
+ Bin8,
+ Bin16,
+ Bin32,
FixedArray(u8),
Array16,
Array32,
FixedMap(u8),
Map16,
Map32,
+ FixExt1,
}
imp... | 3 | 132 | 8 |
49eb36d18f3715fb30768bb813324df19f714afc | Evgeny Safronov | 2015-03-24T08:22:40 | [Dependencies] Update Byteorder. | diff --git a/Cargo.lock b/Cargo.lock
index f8c36cc..4f74238 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,7 +2,7 @@
name = "msgpack"
version = "0.1.0"
dependencies = [
- "byteorder 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 0.3.1 (registry+https://github.com/rust-lang/crates.io-in... | 1 | 2 | 2 |
5c5e7a38f527e74f7dadbfe5004b6d758153890a | Evgeny Safronov | 2015-03-22T14:19:16 | [Decode] Decoding f32/f64. | diff --git a/src/lib.rs b/src/lib.rs
index fef47fe..645b0b6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -30,6 +30,8 @@ enum Marker {
I16,
I32,
I64,
+ F32,
+ F64,
FixedString(u8),
Str8,
Str16,
@@ -55,8 +57,11 @@ impl FromPrimitive for Marker {
val @ 0x90 ... 0x9f => Some(... | 1 | 152 | 0 |
4ac53c7d34e557d60d846a306d13b9bacd8fa74e | Evgeny Safronov | 2015-03-22T10:50:20 | [Decoder] Decoding map size. | diff --git a/src/lib.rs b/src/lib.rs
index ace97eb..fef47fe 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,6 +14,7 @@ pub const MSGPACK_VERSION : u32 = 5;
const FIXSTR_SIZE : u8 = 0x1f;
const FIXARRAY_SIZE : u8 = 0x0f;
+const FIXMAP_SIZE : u8 = 0x0f;
enum Marker {
PositiveFixnum(u8),
@@ -36,6 +37,9 @@ ... | 1 | 94 | 3 |
15a621ec1dba4a7943ce5349dcc7d0a449c3bb41 | Evgeny Safronov | 2015-03-21T09:28:16 | [Decode] Decoding array16/32 size. | diff --git a/src/lib.rs b/src/lib.rs
index 89650e3..ace97eb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,6 +34,8 @@ enum Marker {
Str16,
Str32,
FixedArray(u8),
+ Array16,
+ Array32,
}
impl FromPrimitive for Marker {
@@ -61,6 +63,8 @@ impl FromPrimitive for Marker {
0xd9 => Some(... | 1 | 81 | 2 |
beb39562d81dd9ec69859afb0d88b014a290b21f | Evgeny Safronov | 2015-03-21T09:03:23 | [UT] Code style. | diff --git a/src/lib.rs b/src/lib.rs
index 8f8a88c..89650e3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1004,7 +1004,10 @@ fn from_empty_array_read_size() {
#[test]
fn from_fixarray_max_read_size() {
- let buf: &[u8] = &[0x9f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0... | 1 | 4 | 1 |
2eb520e67358324634c96006a4215e1746721628 | Evgeny Safronov | 2015-03-20T13:49:47 | [UT] Decoding a fixed array with max size. | diff --git a/src/lib.rs b/src/lib.rs
index 21ff53c..8f8a88c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1002,4 +1002,13 @@ fn from_empty_array_read_size() {
assert_eq!(1, cur.position());
}
+#[test]
+fn from_fixarray_max_read_size() {
+ let buf: &[u8] = &[0x9f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07... | 1 | 9 | 0 |
56c86131b5038431a799445aa31dc029e270f882 | Evgeny Safronov | 2015-03-20T13:45:45 | [Decode] Decode fixed array size. | diff --git a/src/lib.rs b/src/lib.rs
index 1ba3923..21ff53c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,7 +12,8 @@ use byteorder::{ReadBytesExt};
pub const MSGPACK_VERSION : u32 = 5;
-const FIXSTR_SIZE : u8 = 0x1f;
+const FIXSTR_SIZE : u8 = 0x1f;
+const FIXARRAY_SIZE : u8 = 0x0f;
enum Marker {
Positi... | 1 | 31 | 1 |
316f30def9704665edcb80842a3cedeef4b479f0 | Evgeny Safronov | 2015-03-20T11:04:02 | [CS] And again. | diff --git a/src/lib.rs b/src/lib.rs
index 3421fe3..1ba3923 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -15,7 +15,7 @@ pub const MSGPACK_VERSION : u32 = 5;
const FIXSTR_SIZE : u8 = 0x1f;
enum Marker {
- Fixnum(u8),
+ PositiveFixnum(u8),
NegativeFixnum(i8),
Null,
True,
@@ -41,7 +41,7 @@ impl Fro... | 1 | 4 | 4 |
f722e70e2a5e92b246bfa51fb46a37852a72907d | Evgeny Safronov | 2015-03-20T10:45:41 | [CS] Renaming again. | diff --git a/src/lib.rs b/src/lib.rs
index 29b5b63..3421fe3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -712,7 +712,7 @@ fn from_str_strfix_ref() {
}
#[test]
-fn from_negative_fixnum_min() {
+fn from_nfix_min() {
let buf: &[u8] = &[0xe0];
let mut cur = Cursor::new(buf);
@@ -721,7 +721,7 @@ fn from_negat... | 1 | 3 | 3 |
8081835ab00633a6177d3873bdfa8d15046c73ca | Evgeny Safronov | 2015-03-20T10:45:25 | [Decode] Clever integer decoding. | diff --git a/src/lib.rs b/src/lib.rs
index 877f4ad..29b5b63 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -174,12 +174,7 @@ pub fn read_i8<R>(rd: &mut R) -> Result<i8>
where R: Read
{
match try!(read_marker(rd)) {
- Marker::I8 => {
- match rd.read_i8() {
- Ok(val) => Ok(val),
... | 1 | 150 | 24 |
8920f597e3d5ba966272e70f2c67c00f48a7c5b1 | Evgeny Safronov | 2015-03-20T10:44:03 | [CS] Tiny renaming. | diff --git a/src/lib.rs b/src/lib.rs
index 23544a4..877f4ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -151,8 +151,7 @@ pub fn read_bool<R>(rd: &mut R) -> Result<bool>
}
// Tries to read exact positive fixnum from the reader.
-// TODO: Maybe rename to something less verbose.
-pub fn read_positive_fixnum_exact<R>(r... | 1 | 4 | 5 |
eb8a27f251391eaa6d004ad88dcd0f8904958dba | Evgeny Safronov | 2015-03-16T20:55:40 | [Dev] Decode i64 strictly. | diff --git a/src/lib.rs b/src/lib.rs
index f80be51..23544a4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -27,6 +27,7 @@ enum Marker {
I8,
I16,
I32,
+ I64,
FixedString(u8),
Str8,
Str16,
@@ -53,6 +54,7 @@ impl FromPrimitive for Marker {
0xd0 => Some(Marker::I8),
0... | 1 | 54 | 1 |
4bc062da58bd892eb067886bb18a22e3d1bec982 | Evgeny Safronov | 2015-03-16T20:45:53 | [Dev] Decode i32 strictly. | diff --git a/src/lib.rs b/src/lib.rs
index 43edcd5..f80be51 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,6 +26,7 @@ enum Marker {
U64,
I8,
I16,
+ I32,
FixedString(u8),
Str8,
Str16,
@@ -51,6 +52,7 @@ impl FromPrimitive for Marker {
0xcf => Some(Marker::U64),
... | 1 | 53 | 1 |
75011cb456c444ebf7c92336b86e34f22e2e2370 | Evgeny Safronov | 2015-03-16T20:24:30 | [Dev] Decode i16 strictly. | diff --git a/src/lib.rs b/src/lib.rs
index 9a7e844..43edcd5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -25,6 +25,7 @@ enum Marker {
U32,
U64,
I8,
+ I16,
FixedString(u8),
Str8,
Str16,
@@ -49,6 +50,7 @@ impl FromPrimitive for Marker {
0xce => Some(Marker::U32),
... | 1 | 53 | 1 |
45403b365b90f0fc404dd848d3044e82e8b2cfeb | Evgeny Safronov | 2015-03-16T19:06:23 | [Dev] Decoding I8 strictly. | diff --git a/src/lib.rs b/src/lib.rs
index 916c29f..9a7e844 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,6 +24,7 @@ enum Marker {
U16,
U32,
U64,
+ I8,
FixedString(u8),
Str8,
Str16,
@@ -47,6 +48,7 @@ impl FromPrimitive for Marker {
0xcd => Some(Marker::U16),
... | 1 | 56 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.