#[repr(C)]pub struct FfiStr {
pub ptr: *const u8,
pub len: usize,
}Expand description
A borrowed UTF-8 string. Not NUL-terminated.
Lifetime rules: an FfiStr returned by a host callback stays valid until
the next re-entering callback (see the rooting contract); an FfiStr
passed to a host callback only needs to be valid for that call.
Fields§
§ptr: *const u8Pointer to the first byte. Must be non-null in both directions - an
empty string is a non-null pointer with len == 0 (e.g. C’s "");
a null pointer is not a valid string value.
len: usizeLength in bytes.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Send for FfiStr
impl !Sync for FfiStr
impl Freeze for FfiStr
impl RefUnwindSafe for FfiStr
impl Unpin for FfiStr
impl UnsafeUnpin for FfiStr
impl UnwindSafe for FfiStr
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