pub struct WString(/* private fields */);Expand description
An owned, NUL-terminated UTF-16 string, to pass to the target as a
wchar_t*.
§Examples
use imping_runtime::WString;
let name = WString::from("Hero");
assert_eq!(name.to_wide(), [72, 101, 114, 111]);Implementations§
Source§impl WString
impl WString
Sourcepub fn as_ptr(&self) -> WStrPtr
pub fn as_ptr(&self) -> WStrPtr
Returns a pointer to the string, valid while it is alive and unchanged.
Sourcepub fn to_wide(&self) -> &[u16]
pub fn to_wide(&self) -> &[u16]
Returns the string’s UTF-16 code units, without the terminating NUL.
Sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Returns the string as UTF-8, with unpaired surrogates replaced by �.
Trait Implementations§
impl Eq for WString
impl StructuralPartialEq for WString
Auto Trait Implementations§
impl Freeze for WString
impl RefUnwindSafe for WString
impl Send for WString
impl Sync for WString
impl Unpin for WString
impl UnsafeUnpin for WString
impl UnwindSafe for WString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more