pub fn from_os_str<S: AsRef<OsStr> + ?Sized>(s: &S) -> Self {
        Self {
            inner: platform::os_to_wide(s.as_ref()),
        }
    }
/// Encodes a `U16String` copy from an `OsStr`.
///
/// This makes a wide string copy of the `OsStr`. Since `OsStr` makes no guarantees that it is
/// valid data, there is no guarantee that the resulting `U16String` will be valid UTF-16.
///
/// # Examples
///
/// ```rust
/// use widestring::U16String;
/// let s = "MyString";
/// // Create a wide string from the string
/// let wstr = U16String::from_os_str(s);
///
/// assert_eq!(wstr.to_string().unwrap(), s);
/// ```
Encodes a `U16String` copy from an `OsStr`.
This makes a wide string copy of the `OsStr`. Since `OsStr` makes no guarantees that it is
valid data, there is no guarantee that the resulting `U16String` will be valid UTF-16.
Encodes a ` U16String ` copy from an ` OsStr ` . This makes a wide string copy of the ` OsStr ` . Since ` OsStr ` makes no guarantees that it is valid data there is no guarantee that the resulting ` U16String ` will be valid UTF - 16 .
pub fn from_os_str<S: AsRef<OsStr> + ?Sized>(s: &S) -> Self {
        Self {
            inner: platform::os_to_wide(s.as_ref()),
        }
    }
pub fn from_os_str < S : AsRef < OsStr > + ? Sized > ( s : & S ) -> Self { Self { inner : platform :: os_to_wide ( s . as_ref ( ) ) , } }
Encodes a `U16String` copy from an `OsStr`.
Encodes a ` U16String ` copy from an ` OsStr ` .
s
&S
s
&S
examples
```rust
use widestring::U16String;
let s = "MyString";
Create a wide string from the string
let wstr = U16String::from_os_str(s).


` ` ` rust use widestring :: U16String ; let s = " MyString " ; Create a wide string from the string let wstr = U16String :: from_os_str ( s ) .