I think the "str" implementation is part of the "core" crate, thus I should be able to create a "str" object without using the "std" crate. However, I believe the only way to make a str object is with a static string, or std::str::from_utf8() that is from the std crate.
I am willing to even use unsafe code if that can do it. I mean I am creating a u8 slice myself that is 100% valid UTF-8, yet it is not a str slice; frustrating...
It's available in core: core::str::from_utf8
The lib maintainers like to have everything available under
std, so things in
core are re-exported to
std. If you find yourself on a page like this one, you can click
src to see it takes you to something in
core didn't always exist, sometimes things move from
core, there's also
alloc, etc. But AFAICT the "re-export to
std" pattern is followed for all
alloc-from-the-start items too.)