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.
Example
use rustix::path::DecInt;
assert_eq!(
format!("hello {}", DecInt::new(9876).as_ref().display()),
"hello 9876"
);
Implementations
sourceimpl DecInt
impl DecInt
Trait Implementations
sourceimpl Arg for DecInt
impl Arg for DecInt
sourcefn to_string_lossy(&self) -> Cow<'_, str>
fn to_string_lossy(&self) -> Cow<'_, str>
Returns a potentially-lossy rendering of this string as a Cow<'_, str>
. Read more
sourcefn as_cow_z_str(&self) -> Result<Cow<'_, ZStr>>
fn as_cow_z_str(&self) -> Result<Cow<'_, ZStr>>
Returns a view of this string as a maybe-owned ZStr
.
sourcefn into_z_str<'b>(self) -> Result<Cow<'b, ZStr>> where
Self: 'b,
fn into_z_str<'b>(self) -> Result<Cow<'b, ZStr>> where
Self: 'b,
sourcefn into_with_z_str<T, F>(self, f: F) -> Result<T> where
Self: Sized,
F: FnOnce(&ZStr) -> Result<T>,
fn into_with_z_str<T, F>(self, f: F) -> Result<T> where
Self: Sized,
F: FnOnce(&ZStr) -> Result<T>,
Runs a closure with self
passed in as a &ZStr
.
sourcefn as_cow_c_str(&self) -> Result<Cow<'_, ZStr>>
fn as_cow_c_str(&self) -> Result<Cow<'_, ZStr>>
Returns a view of this string as a maybe-owned ZStr
.
Auto Trait Implementations
impl RefUnwindSafe for DecInt
impl Send for DecInt
impl Sync for DecInt
impl Unpin for DecInt
impl UnwindSafe for DecInt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more