Hacker News new | past | comments | ask | show | jobs | submit login

Does rust have a structure to handle something like a stringview?



Yes, a borrowed string slice `&str`, whose lifetime is tracked precisely by the compiler to avoid use-after-free errors. https://doc.rust-lang.org/book/ch04-03-slices.html#string-sl...


That's one of the language's primitives: https://doc.rust-lang.org/std/primitive.str.html




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: