Skip to main content

buffer_to_string

Function buffer_to_string 

Source
pub fn buffer_to_string(buffer: &RUMBuffer) -> RUMResult<RUMString>
Expand description

Convert buffer to string.

ยงExample

use rumtk_core::strings::buffer_to_string;
use rumtk_core::types::RUMBuffer;

const expected: &str = "Hello World!";
let buffer = RUMBuffer::from_static(expected.as_bytes());
let result = buffer_to_string(&buffer).unwrap();

assert_eq!(result, expected, "Buffer to RUMString conversion failed!");