Skip to main content

string_to_buffer

Function string_to_buffer 

Source
pub fn string_to_buffer(data: &str) -> RUMBuffer
Expand description

Convert buffer to string.

ยงExample

use rumtk_core::strings::{buffer_to_string, string_to_buffer};
use rumtk_core::types::RUMBuffer;

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

assert_eq!(result, expected, "str to RUMBuffer conversion failed!");