Skip to content

Commit 12ad4dc

Browse files
committed
Doc: minor documentation update.
Also fixed some markdown bugs, fixes #31.
1 parent c524c4f commit 12ad4dc

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/decode.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! # Note
1+
//! Provides various functions and structs for MessagePack decoding.
22
//!
33
//! Most of the function defined in this module will silently handle interruption error (EINTR)
44
//! received from the given `Read` to be in consistent state with the `Write::write_all` method in
@@ -1153,6 +1153,8 @@ pub fn read_map_size<R>(rd: &mut R) -> Result<u32, ValueReadError>
11531153
}
11541154
}
11551155

1156+
/// Attempts to read up to 5 bytes from the given reader and to decode them as Binary array length.
1157+
///
11561158
/// # Note
11571159
///
11581160
/// This function will silently retry on every EINTR received from the underlying `Read` until
@@ -1169,10 +1171,19 @@ pub fn read_bin_len<R>(rd: &mut R) -> Result<u32, ValueReadError>
11691171
}
11701172
}
11711173

1174+
/// Attempts to read some bytes from the given slice until a complete Binary message is decoded,
1175+
/// returning a borrowed slice with the data.
1176+
///
1177+
/// This includes reading both length and the data itself.
1178+
///
11721179
/// # Note
11731180
///
11741181
/// This function will silently retry on every EINTR received from the underlying `Read` until
11751182
/// successful read.
1183+
///
1184+
/// # Unstable
1185+
///
1186+
/// This function is unstable, moreover I have a plan to drop it.
11761187
// TODO: Docs; not sure about naming.
11771188
pub fn read_bin_borrow(rd: &[u8]) -> Result<&[u8], ValueReadError> {
11781189
let mut cur = io::Cursor::new(rd);

src/encode.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Provides various functions and structs for MessagePack encoding.
2+
13
use std::convert::From;
24
use std::error::Error;
35
use std::fmt;
@@ -846,6 +848,8 @@ impl From<ValueWriteError> for Error {
846848
}
847849
}
848850

851+
/// Encodes and attempts to write the most efficient representation of the given Value.
852+
///
849853
/// # Note
850854
///
851855
/// All instances of `ErrorKind::Interrupted` are handled by this function and the underlying

src/value.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Contains Value and ValueRef structs and its conversion traits.
2+
13
#[derive(Copy, Clone, Debug, PartialEq)]
24
pub enum Integer {
35
/// Every non-negative integer is treated as u64, even if it fits in i64.

0 commit comments

Comments
 (0)