Skip to main content

read_string_max

Function read_string_max 

Source
pub fn read_string_max(
    buf: &mut impl Buf,
    max_len: usize,
) -> Result<String, ProtocolError>
Expand description

Read a Minecraft protocol string with a custom maximum length.

ยงErrors

Returns an error if the string length exceeds max_len or UTF-8 decoding fails.