MCPcopy Create free account
hub / github.com/3Hren/msgpack-rust / write_u16

Function write_u16

src/encode.rs:317–322  ·  view source on GitHub ↗

Encodes and attempts to write an `u16` value strictly as a 3-byte sequence into the given write. The first byte becomes the marker and the others will represent the data itself. Note, that this function will encode the given value in 3-byte sequence no matter what, even if the value can be represented using single byte as a positive fixnum. If you need to fit the given buffer efficiently use `w

(wr: &mut W, val: u16)

Source from the content-addressed store, hash-verified

315/// This function will return `ValueWriteError` on any I/O error occurred while writing either the
316/// marker or the data, except the EINTR, which is handled internally.
317pub fn write_u16<W>(wr: &mut W, val: u16) -> Result<(), ValueWriteError>
318 where W: Write
319{
320 try!(write_marker(wr, Marker::U16));
321 write_data_u16(wr, val)
322}
323
324/// Encodes and attempts to write an `u32` value strictly as a 5-byte sequence into the given write.
325///

Callers 3

write_uintFunction · 0.85
write_sint_effFunction · 0.85
pass_pack_u16Function · 0.85

Calls 1

write_markerFunction · 0.85

Tested by 1

pass_pack_u16Function · 0.68