Skip to main content

Crate windy

Crate windy 

Source
Expand description

§Windy

crates.io docs.rs

Windows string library for ANSI strings and wide strings.

§Features

  • Owned ANSI strings: AString.
  • Owned wide strings: WString.
  • Borrowed ANSI strings: AStr.
  • Borrowed wide strings: WStr.
  • Dynamically-code-paged ANSI strings: DAString and DAStr.
  • Windows ANSI_STRING and UNICODE_STRING wrappers.
  • Conversions between ANSI strings, wide strings, and UTF-8 String values.
  • no_std support for borrowed string types.

§Installation

Add this crate to Cargo.toml:

[dependencies]
windy = "0.4.0"

§no_std support

Disable default features to build without std:

--no-default-features

Owned string types are available only with the std feature.

§Macros

The companion windy-macros crate provides compile-time conversion from UTF-8 string literals to WString or AString.

[dependencies]
windy = "0.4.0"
windy-macros = "0.3.0"

§License

This software is released under the MIT or Apache-2.0 License, see LICENSE-MIT or LICENSE-APACHE.

Modules§

traits

Structs§

ANSI_STRING
ANSI_STRING
AStr
A borrowed NUL-terminated ANSI string for code page CP.
AString
An owned NUL-terminated ANSI string for code page CP.
AnsiString
A borrowed wrapper for a Windows ANSI_STRING.
DAStr
A borrowed NUL-terminated ANSI string with a runtime-selected code page.
DAString
An owned NUL-terminated ANSI string with a runtime-selected code page.
UNICODE_STRING
UNICODE_STRING
UnicodeString
A borrowed wrapper for a Windows UNICODE_STRING.
WStr
A borrowed NUL-terminated wide string.
WString
An owned NUL-terminated wide string.

Enums§

ConvertError
An error returned by string validation or conversion.
StringFormatError
An invalid NUL-terminated string format.

Constants§

CP_ACP
CP_UTF8
ERROR_INSUFFICIENT_BUFFER
ERROR_INVALID_PARAMETER
ERROR_NO_UNICODE_TRANSLATION
MB_ERR_INVALID_CHARS
WC_ERR_INVALID_CHARS
WC_NO_BEST_FIT_CHARS

Functions§

is_acceptable_code_page
Returns true if the specified code page identifier can be used with types such as AStr.
is_valid_code_page
Returns whether code_page identifies a code page installed on the current operating system, as determined by IsValidCodePage.

Type Aliases§

ACPAnsiString
Alias for AnsiString using the process ANSI code page.
ACPStr
Borrowed ANSI string using CP_ACP.
ACPString
Owned ANSI string using CP_ACP.
ConvertResult
Result type for fallible string operations.