pub struct DecInt { /* private fields */ }
Expand description
Format an integer into a decimal Path
component, without constructing a
temporary PathBuf
or String
.
This is used for opening paths such as /proc/self/fd/<fd>
on Linux.
use rustix::path::DecInt;
assert_eq!(
format!("hello {}", DecInt::new(9876).as_ref().display()),
"hello 9876"
);
Construct a new path component from an integer.
Construct a new path component from a file descriptor.
Return the raw byte buffer.
Return the raw byte buffer as a &str
.
Return the raw byte buffer as a &ZStr
.
Return the raw byte buffer as a &CStr
.
Returns a view of this string as a string slice.
Returns a potentially-lossy rendering of this string as a Cow<'_, str>
. Read more
Returns a view of this string as a maybe-owned ZStr
.
Consumes self
and returns a view of this string as a maybe-owned
ZStr
. Read more
Runs a closure with self
passed in as a &ZStr
.
Returns a view of this string as a maybe-owned ZStr
.
Consumes self
and returns a view of this string as a maybe-owned
ZStr
. Read more
Runs a closure with self
passed in as a &ZStr
.
Performs copy-assignment from source
. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.