pub struct FfiString { /* private fields */ }Expand description
Owned C string returned by FFI. Must be freed with eggfetch_string_free.
Implementations§
Source§impl FfiString
impl FfiString
Sourcepub unsafe fn from_string(s: String) -> Option<Self>
pub unsafe fn from_string(s: String) -> Option<Self>
Create an owned C string from a Rust String.
Returns None if the string contains an interior null byte. Callers
must surface that case as a null pointer or error code; silently
substituting placeholder content would corrupt the reported value.
§Safety
Caller must free the returned FfiString with eggfetch_string_free.
Sourcepub unsafe fn from_static(s: &'static str) -> Option<Self>
pub unsafe fn from_static(s: &'static str) -> Option<Self>
Create an owned C string from a static str.
Returns None if the string contains an interior null byte.
§Safety
Caller must free the returned FfiString with eggfetch_string_free.
Trait Implementations§
Auto Trait Implementations§
impl !Send for FfiString
impl !Sync for FfiString
impl Freeze for FfiString
impl RefUnwindSafe for FfiString
impl Unpin for FfiString
impl UnsafeUnpin for FfiString
impl UnwindSafe for FfiString
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