rstd 0.1.0
Loading...
Searching...
No Matches
rstd::ref< path::Path > Struct Reference
module rstd

A borrowed reference to a filesystem path. More...

Inheritance diagram for rstd::ref< path::Path >:
rstd::ref_base< ref< path::Path >, u8[], false >

Public Member Functions

constexpr ref (ref< OsStr > s) noexcept
 Construct from a ref<OsStr>.
 
constexpr ref (ref< str > s) noexcept
 Construct from a ref<str>.
 
constexpr ref (const char *c) noexcept
 Construct from a null-terminated C string.
 
constexpr auto as_os_str () const noexcept -> ref< OsStr >
 Returns the underlying OsStr.
 
constexpr auto to_str () const noexcept -> Option< ref< str > >
 Attempts to yield a ref<str> if the path is valid UTF-8.
 
auto to_string_lossy () const -> String
 Converts to a String, replacing invalid UTF-8 with U+FFFD.
 
constexpr auto is_absolute () const noexcept -> bool
 Returns true if the path starts with a root separator.
 
constexpr auto is_relative () const noexcept -> bool
 Returns true if the path is not absolute.
 
constexpr auto parent () const noexcept -> Option< ref< path::Path > >
 Returns the parent path (everything before the last component).
 
constexpr auto file_name () const noexcept -> Option< ref< OsStr > >
 Returns the final component of the path (file or directory name).
 
constexpr auto extension () const noexcept -> Option< ref< OsStr > >
 Returns the extension of the file name (after the last .).
 
- Public Member Functions inherited from rstd::ref_base< ref< path::Path >, u8[], false >

Additional Inherited Members

- Public Types inherited from rstd::ref_base< ref< path::Path >, u8[], false >
using value_type
 we only process T[] for value_type
 
- Static Public Member Functions inherited from rstd::ref_base< ref< path::Path >, u8[], false >

Detailed Description

A borrowed reference to a filesystem path.

Member Function Documentation

◆ parent()

auto rstd::ref< path::Path >::parent ( ) const -> Option<ref<path::Path>>
inlineconstexprnoexcept

Returns the parent path (everything before the last component).

Returns None for root or empty paths.


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