#[repr(transparent)]pub struct UnixStr(_);
Implementations§
source§impl UnixStr
impl UnixStr
sourcepub const unsafe fn from_str_unchecked(s: &str) -> &UnixStr
pub const unsafe fn from_str_unchecked(s: &str) -> &UnixStr
Safety
&str
needs to be null terminated or downstream UB may occur
sourcepub const fn from_str_checked(s: &str) -> &UnixStr
pub const fn from_str_checked(s: &str) -> &UnixStr
Const instantiation of a &UnixStr
from a &str
.
Should only be used in a const
-context, although rustc
does not let me enforce this.
Panics
This method panics since it’s supposed to produce a comptime error, it’s not particularly efficient.
Trait Implementations§
source§impl AsUnixStr for &UnixStr
impl AsUnixStr for &UnixStr
source§impl AsUnixStr for &mut UnixStr
impl AsUnixStr for &mut UnixStr
source§impl From<&UnixStr> for UnixString
impl From<&UnixStr> for UnixString
source§fn from(s: &UnixStr) -> UnixString
fn from(s: &UnixStr) -> UnixString
Converts to this type from the input type.
source§impl PartialEq<UnixStr> for UnixStr
impl PartialEq<UnixStr> for UnixStr
source§impl ToUnixString for &UnixStr
impl ToUnixString for &UnixStr
source§fn to_unix_string(&self) -> Result<UnixString, Error>
fn to_unix_string(&self) -> Result<UnixString, Error>
Turn this into a
UnixString
Read moresource§impl ToUnixString for &mut UnixStr
impl ToUnixString for &mut UnixStr
source§fn to_unix_string(&self) -> Result<UnixString, Error>
fn to_unix_string(&self) -> Result<UnixString, Error>
Turn this into a
UnixString
Read more