MCPcopy Create free account
hub / github.com/PowerShell/DSC / to_wide

Function to_wide

resources/windows_service/src/service.rs:17–19  ·  view source on GitHub ↗

Encode a Rust string as a null-terminated UTF-16 buffer.

(s: &str)

Source from the content-addressed store, hash-verified

15
16/// Encode a Rust string as a null-terminated UTF-16 buffer.
17fn to_wide(s: &str) -> Vec<u16> {
18 s.encode_utf16().chain(std::iter::once(0)).collect()
19}
20
21/// Convert a `PWSTR` to an `Option<String>`.
22///

Callers 4

get_serviceFunction · 0.85
get_service_detailsFunction · 0.85
set_serviceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected