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

Method as_cow_c_str

src/path/arg.rs:122–126  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

120 #[cfg(feature = "alloc")]
121 #[inline]
122 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
123 Ok(Cow::Owned(
124 CString::new(*self).map_err(|_cstr_err| io::Errno::INVAL)?,
125 ))
126 }
127
128 #[cfg(feature = "alloc")]
129 #[inline]

Callers 1

openat2_moreFunction · 0.80

Calls 5

into_c_strMethod · 0.80
as_c_strMethod · 0.80
as_strMethod · 0.45
as_refMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected