Top "Rust" questions

Rust is a systems programming language without a garbage collector focused on three goals: safety, speed, and concurrency.

How do I convert a Vector of bytes (u8) to a string

I am trying to write simple TCP/IP client in Rust and I need to print out the buffer I …

rust
How to convert a String into a &'static str

How do I convert a String into a &str? More specifically, I would like to convert it into a …

rust
Cannot move out of borrowed content / cannot move out of behind a shared reference

I don't understand the error cannot move out of borrowed content. I have received it many times and I have …

reference rust move-semantics borrow-checker
How do I create a global, mutable singleton?

What is the best way to create and use a struct with only one instantiation in the system? Yes, this …

rust
What are the differences between Rust's `String` and `str`?

Why does Rust have String and str? What are the differences between String and str? When does one use String …

string rust
Rust package with both a library and a binary?

I would like to make a Rust package that contains both a reusable library (where most of the program is …

rust rust-cargo
What is the syntax for a multiline string literal?

I'm having a hard time figuring out how string syntax works in Rust. Specifically, I'm trying to figure out how …

string rust
Why doesn't println! work in Rust unit tests?

I've implemented the following method and unit test: use std::fs::File; use std::path::Path; use std::io::prelude::*; …

rust println
How do you iterate over a string by character

I have a string and I need to scan for every occurrence of "foo" and read all the text following …

string iterator rust
What is the idiomatic Rust way to copy/clone a vector in a parameterized function?

I'm trying to write a parameterized function that takes an immutable vector, clones or copies it, does something to the …

rust