Skip to main content
CStr
relibc
0.2.5
CStr
Aliased Type
Associated Functions
borrow
from_bytes_with_nul_unchecked
from_bytes_with_nul
from_bytes_until_nul
Methods
to_bytes
to_bytes_with_nul
to_owned_cstring
to_str
to_string_lossy
Trait Implementations
From<&CStr>
In relibc::
c_
str
relibc
::
c_str
Type Alias
CStr
Copy item path
Source
pub type CStr<'a> =
NulStr
<'a,
Thin
>;
Aliased Type
§
pub struct CStr<'a> {
/* private fields */
}
Implementations
§
Source
§
impl<'a>
CStr
<'a>
Source
pub fn
to_owned_cstring
(self) ->
CString
Source
pub fn
borrow
(string: &'a
CString
) -> Self
Source
pub fn
to_bytes
(self) -> &'a [
u8
]
Source
pub fn
to_bytes_with_nul
(self) -> &'a [
u8
]
Source
pub fn
to_str
(self) ->
Result
<&'a
str
,
Utf8Error
>
Source
pub fn
to_string_lossy
(self) ->
Cow
<'a,
str
>
Source
pub const unsafe fn
from_bytes_with_nul_unchecked
(bytes: &'a [
u8
]) -> Self
Source
pub fn
from_bytes_with_nul
( bytes: &'a [
u8
], ) ->
Result
<Self,
FromCharsWithNulError
>
Source
pub fn
from_bytes_until_nul
( bytes: &'a [
u8
], ) ->
Result
<Self,
FromCharsUntilNulError
>
Trait Implementations
§
Source
§
impl
From
<&
CStr
> for
CStr
<'_>
Source
§
fn
from
(s: &
CStr
) -> Self
Converts to this type from the input type.