# 1.0.0[−][src]Trait std::os::windows::ffi::OsStrExt

    pub trait OsStrExt {
        fn encode_wide(&self) -> EncodeWide;
    }

This is supported on Windows only.

Windows-specific extensions to `OsStr`.

## Required methods

###
ⓘImportant traits for EncodeWide<'a>

### Important traits for EncodeWide<'a>

`impl<'a> Iterator for EncodeWide<'a> type Item = u16;`
`fn encode_wide(&self) -> EncodeWide`

This is supported on Windows only.

Re-encodes an `OsStr` as a wide character sequence, i.e., potentially ill-formed UTF-16.

This is lossless: calling `OsString::from_wide` and then `encode_wide` on the result will yield the original code units. Note that the encoding does not add a final null terminator.

# Examples

    use std::ffi::OsString;
    use std::os::windows::prelude::*;

    // UTF-16 encoding for "Unicode".
    let source = [0x0055, 0x006E, 0x0069, 0x0063, 0x006F, 0x0064, 0x0065];

    let string = OsString::from_wide(&source[..]);

    let result: Vec<u16> = string.encode_wide().collect();
    assert_eq!(&source[..], &result[..]);Run

Loading content...

## Implementors

### `impl OsStrExt for OsStr`[src]

####
ⓘImportant traits for EncodeWide<'a>

### Important traits for EncodeWide<'a>

`impl<'a> Iterator for EncodeWide<'a> type Item = u16;`
`fn encode_wide(&self) -> EncodeWide`[src]

This is supported on Windows only.
Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)