File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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.
11771188pub fn read_bin_borrow ( rd : & [ u8 ] ) -> Result < & [ u8 ] , ValueReadError > {
11781189 let mut cur = io:: Cursor :: new ( rd) ;
Original file line number Diff line number Diff line change 1+ //! Provides various functions and structs for MessagePack encoding.
2+
13use std:: convert:: From ;
24use std:: error:: Error ;
35use 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
Original file line number Diff line number Diff line change 1+ //! Contains Value and ValueRef structs and its conversion traits.
2+
13#[ derive( Copy , Clone , Debug , PartialEq ) ]
24pub enum Integer {
35 /// Every non-negative integer is treated as u64, even if it fits in i64.
You can’t perform that action at this time.
0 commit comments