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

Function write_bool

src/encode.rs:171–178  ·  view source on GitHub ↗

Encodes and attempts to write a bool value into the given write. According to the MessagePack specification, an encoded boolean value is represented as a single byte. # Errors This function will return `FixedValueWriteError` on any I/O error occurred while writing the boolean marker.

(wr: &mut W, val: bool)

Source from the content-addressed store, hash-verified

169/// This function will return `FixedValueWriteError` on any I/O error occurred while writing the
170/// boolean marker.
171pub fn write_bool<W>(wr: &mut W, val: bool) -> Result<(), FixedValueWriteError>
172 where W: Write
173{
174 match val {
175 true => write_fixval(wr, Marker::True),
176 false => write_fixval(wr, Marker::False)
177 }
178}
179
180/// Encodes and attempts to write an unsigned small integer value as a positive fixint into the
181/// given write.

Callers 6

write_valueFunction · 0.85
emit_boolMethod · 0.85
visit_boolMethod · 0.85
write_value_refFunction · 0.85
pass_pack_trueFunction · 0.85
pass_pack_falseFunction · 0.85

Calls 1

write_fixvalFunction · 0.85

Tested by 2

pass_pack_trueFunction · 0.68
pass_pack_falseFunction · 0.68