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

Function write_u32

src/encode.rs:338–343  ·  view source on GitHub ↗

Encodes and attempts to write an `u32` value strictly as a 5-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 5-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: u32)

Source from the content-addressed store, hash-verified

336/// This function will return `ValueWriteError` on any I/O error occurred while writing either the
337/// marker or the data, except the EINTR, which is handled internally.
338pub fn write_u32<W>(wr: &mut W, val: u32) -> Result<(), ValueWriteError>
339 where W: Write
340{
341 try!(write_marker(wr, Marker::U32));
342 write_data_u32(wr, val)
343}
344
345/// Encodes and attempts to write an `u64` value strictly as a 9-byte sequence into the given write.
346///

Callers 3

write_uintFunction · 0.85
write_sint_effFunction · 0.85
pass_pack_u32Function · 0.85

Calls 1

write_markerFunction · 0.85

Tested by 1

pass_pack_u32Function · 0.68