Skip to main content

str_from_raw_parts

Function str_from_raw_parts 

Source
pub(crate) const unsafe fn str_from_raw_parts<'a>(
    ptr: *const u8,
    len: usize,
) -> &'a str
Expand description

ยงSafety

  • ptr must be non-null and point to len initialized bytes of UTF-8 data.
  • ptr is valid for (and not mutated during) lifetime 'a.