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

Function write_i16

src/encode.rs:417–422  ·  view source on GitHub ↗

Encodes and attempts to write an `i16` value 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 fixnum. Also note, that the first byte will always be the i16 marker (`0xd1`). I

(wr: &mut W, val: i16)

Source from the content-addressed store, hash-verified

415/// This function will return `ValueWriteError` on any I/O error occurred while writing either the
416/// marker or the data, except the EINTR, which is handled internally.
417pub fn write_i16<W>(wr: &mut W, val: i16) -> Result<(), ValueWriteError>
418 where W: Write
419{
420 try!(write_marker(wr, Marker::I16));
421 write_data_i16(wr, val)
422}
423
424/// Encodes and attempts to write an `i32` value as a 5-byte sequence into the given write.
425///

Callers 3

write_sintFunction · 0.85
write_sint_effFunction · 0.85
pass_pack_i16Function · 0.85

Calls 1

write_markerFunction · 0.85

Tested by 1

pass_pack_i16Function · 0.68