univstring

Crates.iounivstring
lib.rsunivstring
version0.4.3
sourcesrc
created_at2018-02-27 17:33:39.655344
updated_at2020-10-23 12:17:34.905176
descriptionThe Universal String(Rust String, CString, Wide(UTF-16/UTF-32) CString) trait
homepage
repositoryhttps://github.com/Pctg-x8/univstring
max_upload_size
id53068
size14,699
S.Percentage (Pctg-x8)

documentation

https://docs.rs/univstring

README

The Universal String trait | Documentation

// more optimal way to take some cstrings as argument
fn take_wstr<S: UnivString + ?Sized>(s: &S)
{
  let _ws = s.to_wcstr().unwrap();
  // do something with the WideCString...
}
// call the function
take_wstr("test");
let existing_cstr = CString::new("...").unwrap();
take_wstr(&existing_cstr);
Commit count: 12

cargo fmt