#[repr(C)]pub struct PmpxStr {
pub ptr: *const u8,
pub len: usize,
}Expand description
A cross-boundary string: pointer + length, with no NUL terminator required.
ptr / len describe raw bytes (possibly a path or a command-line argument) which on Unix
need not be valid UTF-8; UTF-8 is checked only where the data is explicitly required to be
text, and a failure returns PMPX_ERR_INVALID_ARGS rather than UB.
It carries a length instead of relying on NUL because the pointer returned by str::as_ptr()
is not guaranteed to be followed by a NUL.
Fields§
§ptr: *const u8Start address. May be null when len == 0.
len: usizeLength in bytes.
Implementations§
Trait Implementations§
impl Copy for PmpxStr
impl Sync for PmpxStr
Auto Trait Implementations§
impl !Send for PmpxStr
impl Freeze for PmpxStr
impl RefUnwindSafe for PmpxStr
impl Unpin for PmpxStr
impl UnsafeUnpin for PmpxStr
impl UnwindSafe for PmpxStr
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