windows-strings (0.100.0+paring.1)

Published 2026-10-14 03:21:29 +09:00 by paring

Installation

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add windows-strings@0.100.0+paring.1 --registry forgejo

About this package

Windows string types

windows-strings

The windows-strings crate provides Windows string types and literals.

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

[dependencies.windows-strings]
version = "0.100"

Use the Windows string types as needed:

use 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");
}

Dependencies

ID Version
windows-link ^0.100.0
Details
Cargo
2026-10-14 03:21:29 +09:00
20
2026-11-10 00:22:51 +09:00
MIT OR Apache-2.0
14 KiB
Assets (1)
Versions (1) View all
0.100.0+paring.1 2026-10-14