winpty-rs-windows-strings

Crates.iowinpty-rs-windows-strings
lib.rswinpty-rs-windows-strings
version0.4.2
created_at2025-08-04 20:40:27.774506+00
updated_at2025-08-04 20:40:27.774506+00
descriptionWindows string types
homepage
repositoryhttps://github.com/microsoft/windows-rs
max_upload_size
id1781141
size54,423
Edgar Andrés Margffoy Tuay (andfoy)

documentation

README

Windows string types

The windows-strings crate provides common Windows string types used by various Windows APIs.

Start by adding the following to your Cargo.toml file:

[dependencies.winpty-rs-windows-strings]
version = "0.4"

Use the Windows string types as needed:

use winpty_rs_windows_strings::*;

const A: PCSTR = s!("ansi");
const W: PCWSTR = w!("wide");

fn main() {
    let b = BSTR::from("bstr");
    let h = HSTRING::from("hstring");

    assert_eq!(b, "bstr");
    assert_eq!(h, "hstring");

    assert_eq!(unsafe { A.to_string().unwrap() }, "ansi");
    assert_eq!(unsafe { W.to_string().unwrap() }, "wide");
}
Commit count: 1734

cargo fmt