rstd 0.1.0
Loading...
Searching...
No Matches
rstd::ffi::OsString Class Referenceexport
module rstd

An owned, platform-native string. More...

Public Member Functions

auto as_os_str () const noexcept -> ref< OsStr >
 Returns a borrowed ref<OsStr>.
 
auto into_string () -> result::Result< String, OsString >
 Attempts to convert to a String.
 
void push (ref< OsStr > s)
 Appends an OsStr to this string.
 
 operator ref< OsStr > () const noexcept
 Implicit conversion to ref<OsStr>.
 

Static Public Member Functions

static auto make () -> OsString
 Creates an empty OsString.
 
static auto from (String &&s) -> OsString
 Creates an OsString from a String (zero-cost move on Unix).
 
static auto from (ref< str > s) -> OsString
 Creates an OsString by copying a ref<str>.
 
static auto from (ref< OsStr > s) -> OsString
 Creates an OsString by copying a ref<OsStr>.
 
static auto from_encoded_bytes_unchecked (Vec< u8 > &&bytes) -> OsString
 Creates an OsString from raw bytes without validation.
 

Detailed Description

An owned, platform-native string.

On Unix this wraps Vec<u8>. Analogous to Rust's OsString.

Member Function Documentation

◆ into_string()

auto rstd::ffi::OsString::into_string ( ) -> result::Result<String, OsString>
inlineexport

Attempts to convert to a String.

Returns Err(self) if the bytes are not valid UTF-8.


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