univstring 0.4.3

The Universal String(Rust String, CString, Wide(UTF-16/UTF-32) CString) trait
Documentation
  • Coverage
  • 58.33%
    7 out of 12 items documented1 out of 7 items with examples
  • Size
  • Source code size: 14.55 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.18 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Pctg-x8/univstring
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Pctg-x8

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);