rmp::encode

Function write_i64

Source
pub fn write_i64<W: RmpWrite>(
    wr: &mut W,
    val: i64,
) -> Result<(), ValueWriteError<W::Error>>
Expand description

Encodes and attempts to write an i64 value as a 9-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 9-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 (0xd3).

If you need to fit the given buffer efficiently use write_sint instead, which automatically selects the appropriate integer representation.

ยงErrors

This function will return ValueWriteError on any I/O error occurred while writing either the marker or the data.