wtf-string 0.1.0

OsString-shaped strings with native, conversion-free u16 (WTF-16) storage for Windows FFI.
Documentation
# Copyright (c) 2026 Mike Grier

[package]
name = "wtf-string"
version = "0.1.0" # x-release-please-version
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme = "README.md"
documentation = "https://docs.rs/wtf-string"
description = "OsString-shaped strings with native, conversion-free u16 (WTF-16) storage for Windows FFI."
keywords = ["windows", "utf-16", "wtf-16", "osstring", "ffi"]
categories = ["encoding", "os::windows-apis", "text-processing"]

[lib]
path = "src/lib.rs"

[features]
default = ["std"]

# `std` adds the Windows `OsStr`/`OsString` interop, which has no `alloc`-only
# equivalent (`OsStr` lives in `std`). Turning it off builds the portable core --
# storage, `str`/`String` conversions, the mutation surface, and the FFI pointer
# surface -- on `alloc` alone (D-11). The `windows-core?/std` forward only
# applies when that optional dependency is also enabled.
std = ["windows-core?/std"]

# Interop with the high-level `windows` crate: adds `Param<PCWSTR>` for
# `&Wtf16String`, so a `windows` API taking `impl Param<PCWSTR>` accepts our
# type directly with no conversion (D-10). Off by default, so the crate keeps
# its zero-dependency default build (D-11).
#
# The impl is written against the `windows-core` version pinned below. A caller
# must be on a `windows`/`windows-core` release that resolves to that same
# semver-compatible version, or its `PCWSTR` is a *different* type and the impl
# will not apply (D-17).
windows-core = ["dep:windows-core"]

[dependencies]
# `default-features = false` keeps this usable from an `alloc`-only build; our
# own `std` feature forwards to its `std` when both are on.
windows-core = { version = "0.62.2", optional = true, default-features = false }

# The storage and str/String conversions are portable; only the OsStr/OsString
# interop is Windows-only. Build docs on a Windows target so that surface is
# documented as well. All features are enabled so the `windows-core` interop is
# documented too.
[package.metadata.docs.rs]
all-features = true
default-target = "x86_64-pc-windows-msvc"
targets = ["x86_64-pc-windows-msvc"]