Function devela::os::linux::io::linux_get_str

source ·
pub fn linux_get_str<const CAP: usize>(
    buffer: &mut [u8; CAP],
    stop: char
) -> &str
Available on crate features unsafe_linux and linux only.
Expand description

Gets a string from stdin backed by a buffer, until the stop char is received.

Examples

use devela::os::linux::linux_get_str;

let mut buf = [0_u8; 32];
let name: &str = linux_get_str::<32>(&mut buf, '\n');