pub struct NgxStr(/* private fields */);
Expand description
Representation of a borrowed Nginx string.
Implementations§
Source§impl NgxStr
impl NgxStr
Sourcepub unsafe fn from_ngx_str<'a>(str: ngx_str_t) -> &'a NgxStr
pub unsafe fn from_ngx_str<'a>(str: ngx_str_t) -> &'a NgxStr
Sourcepub fn from_bytes(bytes: &[u8]) -> &Self
pub fn from_bytes(bytes: &[u8]) -> &Self
Create an NgxStr from a borrowed byte slice.
Sourcepub fn from_bytes_mut(bytes: &mut [u8]) -> &mut Self
pub fn from_bytes_mut(bytes: &mut [u8]) -> &mut Self
Create a mutable NgxStr from a borrowed byte slice.
Sourcepub fn to_str(&self) -> Result<&str, Utf8Error>
pub fn to_str(&self) -> Result<&str, Utf8Error>
Yields a &str
slice if the NgxStr
contains valid UTF-8.