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

Function write_i8

src/encode.rs:395–400  ·  view source on GitHub ↗

Encodes and attempts to write an `i8` value as a 2-byte sequence into the given write. The first byte becomes the marker and the second one will represent the data itself. Note, that this function will encode the given value in 2-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 i8 marker (`0xd0`).

(wr: &mut W, val: i8)

Source from the content-addressed store, hash-verified

393/// assert_eq!([0xd0, 0xee], buf);
394/// ```
395pub fn write_i8<W>(wr: &mut W, val: i8) -> Result<(), ValueWriteError>
396 where W: Write
397{
398 try!(write_marker(wr, Marker::I8));
399 write_data_i8(wr, val)
400}
401
402/// Encodes and attempts to write an `i16` value as a 3-byte sequence into the given write.
403///

Callers 3

write_sintFunction · 0.85
write_sint_effFunction · 0.85
pass_pack_i8Function · 0.85

Calls 1

write_markerFunction · 0.85

Tested by 1

pass_pack_i8Function · 0.68