|
rstd 0.1.0
|
A borrowed reference to a platform-native string. More...
Public Member Functions | |
| constexpr | ref (ref< str > s) noexcept |
Construct from a ref<str> (UTF-8 is always valid OS bytes). | |
| constexpr | ref (const char *c_str) noexcept |
| Construct from a null-terminated C string. | |
| constexpr auto | as_encoded_bytes () const noexcept -> slice< u8 > |
| Returns the encoded bytes of this OS string. | |
| constexpr auto | to_str () const noexcept -> Option< ref< str > > |
| Attempts to convert to a UTF-8 string slice. | |
| auto | to_string_lossy () const -> String |
Converts to a String, replacing invalid UTF-8 with U+FFFD. | |
Public Member Functions inherited from rstd::ref_base< ref< ffi::OsStr >, u8[], false > | |
Additional Inherited Members | |
Public Types inherited from rstd::ref_base< ref< ffi::OsStr >, u8[], false > | |
| using | value_type |
| we only process T[] for value_type | |
Static Public Member Functions inherited from rstd::ref_base< ref< ffi::OsStr >, u8[], false > | |
A borrowed reference to a platform-native string.
|
inlineconstexprnoexcept |
Attempts to convert to a UTF-8 string slice.
Returns None if the bytes are not valid UTF-8.