rstd 0.1.0
Loading...
Searching...
No Matches
rstd::path::PathBuf Class Referenceexport
module rstd

An owned, mutable filesystem path, analogous to Rust's PathBuf. More...

Public Member Functions

auto as_path () const noexcept -> ref< Path >
 Returns a borrowed ref<Path>.
 
auto into_os_string () -> OsString
 Consumes the PathBuf and returns the inner OsString.
 
void push (ref< Path > component)
 Extends the path with component.
 
auto pop () -> bool
 Removes the last component. Returns false if already at root/empty.
 
auto join (ref< Path > component) const -> PathBuf
 Creates a new PathBuf by joining this path with a component.
 
 operator ref< Path > () const noexcept
 Implicit conversion to ref<Path>.
 

Static Public Member Functions

static auto make () -> PathBuf
 Creates an empty PathBuf.
 
static auto from (String &&s) -> PathBuf
 Creates a PathBuf from a String.
 
static auto from (ref< str > s) -> PathBuf
 Creates a PathBuf from a ref<str>.
 
static auto from (OsString &&s) -> PathBuf
 Creates a PathBuf from an OsString.
 
static auto from (const char *s) -> PathBuf
 Creates a PathBuf from a C string.
 

Detailed Description

An owned, mutable filesystem path, analogous to Rust's PathBuf.

Member Function Documentation

◆ push()

void rstd::path::PathBuf::push ( ref< Path > component)
inlineexport

Extends the path with component.

If component is absolute, it replaces the current path. Otherwise, a separator is inserted if needed and component is appended.


The documentation for this class was generated from the following file: