Struct rustix::path::DecInt[][src]

pub struct DecInt { /* fields omitted */ }
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

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.

Return the raw byte buffer.

Trait Implementations

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 the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.