Skip to main content

encode_double

Function encode_double 

Source
pub fn encode_double(out: &mut Vec<u8>, v: f64)
Expand description

,<value>\r\n — a double. inf / -inf / nan are valid wire payloads per spec; we forward Rust’s standard float formatting which emits exactly those tokens.

Vs RESP2’s $<len>\r\n<digits>\r\n shape this saves ~6 B per value (no length prefix, no trailing CRLF after the digits — the digits ARE the CRLF-terminated line). Worth it on ZSCORE flood or ZRANGE WITHSCORES.