MCPcopy Create free account
hub / github.com/PerroEngine/Perro / utf8

Function utf8

perro_source/api_modules/perro_networking/src/util.rs:10–14  ·  view source on GitHub ↗
(bytes: Vec<u8>)

Source from the content-addressed store, hash-verified

8}
9
10pub(crate) fn utf8(bytes: Vec<u8>) -> NetResult<String> {
11 String::from_utf8(bytes).map_err(|err: FromUtf8Error| {
12 NetError::new(NetErrorKind::Handshake, format!("invalid utf8: {err}"))
13 })
14}

Callers 2

decodeMethod · 0.85
map_websocket_binaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected