1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] mod bindings; pub use crate::bindings::*; use std::ffi::CStr; impl Into<String> for aiString { fn into(self) -> String { let content = unsafe { CStr::from_ptr(self.data.as_ptr()) }; content.to_str().unwrap().to_string() } } impl Into<String> for &aiString { fn into(self) -> String { let content = unsafe { CStr::from_ptr( self.data.as_ptr() )}; content.to_str().unwrap().to_string() } }