#[repr(C)]pub struct BorrowedString {
pub ptr: *const u8,
pub length: usize,
}
Expand description
Describes a string of fixed length, which must not be free’d by the recipient. The given length must not include any null terminators that may be present. The string must be valid UTF-8 (or 7-bit ASCII, which is a valid subset of UTF-8).
Fields§
§ptr: *const u8
The start of the string
length: usize
The length of the string in bytes
Implementations§
Source§impl BorrowedString
impl BorrowedString
Sourcepub fn new(value: &'static str) -> BorrowedString
pub fn new(value: &'static str) -> BorrowedString
Create a new API-compatible borrowed string, from a static string slice.
Trait Implementations§
Source§impl Clone for BorrowedString
impl Clone for BorrowedString
Source§fn clone(&self) -> BorrowedString
fn clone(&self) -> BorrowedString
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BorrowedString
impl Debug for BorrowedString
Source§impl PartialEq for BorrowedString
impl PartialEq for BorrowedString
impl Eq for BorrowedString
Auto Trait Implementations§
impl Freeze for BorrowedString
impl RefUnwindSafe for BorrowedString
impl !Send for BorrowedString
impl !Sync for BorrowedString
impl Unpin for BorrowedString
impl UnwindSafe for BorrowedString
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