You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// A helper type for writing string data into `[u16]` buffers.
89
+
///
90
+
/// This type is mainly useful for interop with `libctru` APIs that expect UTF-16 text as input. The writer implements the
91
+
/// [`std::fmt::Write`](https://doc.rust-lang.org/std/fmt/trait.Write.html) trait and ensures that the text is written in-bounds and properly nul-terminated.
92
+
///
93
+
/// # Notes
94
+
///
95
+
/// Subsequent writes to the same `Utf16Writer` will append to the buffer instead of overwriting the existing contents. If you want to start over from the
96
+
/// beginning of the buffer, simply create a new `Utf16Writer`.
97
+
///
98
+
/// If a write causes the buffer to reach the end of its capacity, `std::fmt::Error` will be returned, but all string data up until the end of the capacity will
99
+
/// still be written.
100
+
pubstructUtf16Writer<'a>{
101
+
buf:&'amut[u16],
102
+
index:usize,
103
+
}
104
+
105
+
implUtf16Writer<'_>{
106
+
/// Creates a new [Utf16Writer] that writes its output into the provided buffer.
0 commit comments