MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / into_c_str

Method into_c_str

src/path/arg.rs:130–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 #[cfg(feature = "alloc")]
129 #[inline]
130 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
131 where
132 Self: 'b,
133 {
134 Ok(Cow::Owned(
135 CString::new(self).map_err(|_cstr_err| io::Errno::INVAL)?,
136 ))
137 }
138
139 #[inline]
140 fn into_with_c_str<T, F>(self, f: F) -> io::Result<T>

Callers 2

as_cow_c_strMethod · 0.80
into_with_c_strMethod · 0.80

Calls 4

as_c_strMethod · 0.80
as_strMethod · 0.45
as_bytesMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected