pub struct CStringVec { /* private fields */ }
Expand description
Used to simulate an array of C-style strings.
Implementations§
Source§impl CStringVec
impl CStringVec
Sourcepub fn new(strings: &[&str]) -> Result<Self, Error>
pub fn new(strings: &[&str]) -> Result<Self, Error>
Creates a new C string vector from the provided rust strings.
C strings are continuous byte regions that end in \0
and do not
contain \0
anywhere else.
Use as_c_array
to get an unowned raw pointer to the array, to pass
into FFI C code.
Sourcepub fn as_c_array(&self) -> *const *const c_char
pub fn as_c_array(&self) -> *const *const c_char
Returns the underlying array of C strings as a C array pointer. The array must not change after construction to ensure that this pointer remains valid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CStringVec
impl RefUnwindSafe for CStringVec
impl !Send for CStringVec
impl !Sync for CStringVec
impl Unpin for CStringVec
impl UnwindSafe for CStringVec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more