Function encode_borrowed

Source
pub fn encode_borrowed(
    buf: &mut [u8],
    frame: &BorrowedFrame<'_>,
    int_as_bulkstring: bool,
) -> Result<usize, RedisProtocolError>
Available on crate feature resp2 only.
Expand description

Attempt to encode a borrowed frame into buf.

The caller is responsible for extending buf if a BufferTooSmall error is returned.

Returns the number of bytes encoded.