5

FromBytesWithNulError in core::ffi - Rust

 1 year ago
source link: https://doc.rust-lang.org/stable/core/ffi/struct.FromBytesWithNulError.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

An error indicating that a nul byte was not in the expected position.

The slice used to create a CStr must have one and only one nul byte, positioned at the end.

This error is created by the CStr::from_bytes_with_nul method. See its documentation for more.

Examples

use std::ffi::{CStr, FromBytesWithNulError};

let _: FromBytesWithNulError = CStr::from_bytes_with_nul(b"f\0oo").unwrap_err();
Run

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK