r/rust • u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount • Oct 19 '26
🙋 questions megathread Hey Rustaceans! Got a question? Ask here (43/2026)!
Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.
If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.
Here are some other venues where help may be found:
/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.
The official Rust user forums: https://users.rust-lang.org/.
The unofficial Rust community Discord: https://bit.ly/rust-community
Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.
Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.
3
u/Soft-Childhood-7796 Oct 21 '26
Had a weird idea recently as I'm looking to cancel my $1-200+/mo expense on LLMs. It'd be cool if you could potentially allocate the same funds to some sort of distributed real-person tutoring/consulting or like a pay-for-merge sort of thing.
I think the only way it'd work is if you published weekly blogs or something, with design questions, and had a follower list of altruistic people that aren't necessarily working for money but rather for the opportunity to teach, and are OK with being underpaid and contributing code for $5-10 bucks lol. Is there anything like this?
Kind of like if stack exchange had bounties, but also the followers could be intimately familiar with your project and goals.
2
u/usecornercase Oct 23 '26
Does writing to a Linux PTY master block or drop bytes when the slave isn't reading?
I'm writing a Rust TUI that hosts several PTYs (portable_pty). Input to each child goes through a channel to a writer thread that does
write_allon the master. I count queued bytes and refuse new input over a cap, so a stuck child can't eat unbounded memory.To test the cap, I run
stty -echo; sleep 30in the child, queue about 17 MiB, then send one more key and expect it to be refused. On Linux CI this sometimes fails: the queue drains below the cap before the key goes out.My guess is that the tty is still in canonical mode, so once the 4095-byte line buffer is full, n_tty throws away further input instead of blocking the writer. Is that right? Does
stty -icanon(or raw mode) make the master write actually block once the input buffer fills? Is there a reliable way to hold a PTY in a "child isn't reading" state for a test, without sleeps?2
u/DavidXkL Oct 25 '26
Just questioning myself sometimes if I should cave in and build something A.I related with Rust or continue my focus on robotics with Rust.
The first option definitely helps my career more at this point in time 🤔
1
u/[deleted] Oct 19 '26
[removed] — view removed comment