Reddit » The Rust Programming Language
176 FOLLOWERS
A place for all things related to the Rust programming language - an open-source systems language that emphasizes performance, reliability, and productivity.
Reddit » The Rust Programming Language
1h ago
NeuralRad is the leading platform for Stereotactic Radiosurgery workflow, using deep-learning based auto-segmentation, auto-labeling to assist neurosurgeon and oncologists to make clinical decisions and build better treatment plan for each patient.
submitted by /u/coolwulf
[visit reddit] [comments ..read more
Reddit » The Rust Programming Language
3h ago
submitted by /u/joehillen
[visit reddit] [comments ..read more
Reddit » The Rust Programming Language
5h ago
submitted by /u/mingu3
[visit reddit] [comments ..read more
Reddit » The Rust Programming Language
5h ago
I've recently tuned in to one of Jon Gjenset's recent streams where he discusses the occasional over-reliance on mpsc queues in fan-in situations (i.e., multiple workers emitting events through a single consumer). One alternative he mentions is instead relying on Arc<Mutex<Vec<T>>>> as where:
Workers can extend the buffer with data
Actor can swap the buffer with an empty buffer and process the current buffer, allowing critical zone to be exceptionally small
I tried giving this a shot. We have a serial actor/worker with no internal buffering.
```rust pub async fn serial_ ..read more
Reddit » The Rust Programming Language
7h ago
I wanted <[T]>::first to be infallible, but to otherwise use other methods like <[_]>::rotate, which existing crates like nonempty can't do (without breaking their API).
So I've written nunny, with the following highlights:
- I scraped the rustdoc for std to provide a complete API. With few exceptions, for every Vec<T> -> Box<[T]> there is a NonEmpty<Vec<T>> -> Box<NonEmpty<[T]>>
- Support for exotic types like Cows and boxed slices.
- #[repr(transparent)] gives you flexibility to go from &[u8] -> &NonEmpty<[u8]>
- const a ..read more
Reddit » The Rust Programming Language
9h ago
I've been using tracing for a while, but today I wanted to configure a specific target on a span for later filtering. Turns out it doesn't seem to work as I expected.
use tracing::span; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; fn main() { init_cli_trace(); let span = span!(target: "span_target", parent: None, tracing::Level::INFO, "internal_block"); tracing::info!("outside"); { let _guard = span.enter(); tracing::info!("inside"); } tracing::info!("outside again"); } pub fn init_cli_trace() { let fmt_layer = tracing_subscriber::fmt::layer().with_target(true); t ..read more
Reddit » The Rust Programming Language
9h ago
submitted by /u/progfu
[visit reddit] [comments ..read more
Reddit » The Rust Programming Language
9h ago
Hi everyone,
I recently started learning Rust and built a proof-of-concept REST API for a bookstore application using the Axum framework. I would love to get feedback from the friendly rust community on the code structure, Rust practices, and any other suggestions you might have. Here's the link to the project repository: https://github.com/stkr89/axum-book-store
submitted by /u/stkr89
[visit reddit] [comments ..read more
Reddit » The Rust Programming Language
9h ago
submitted by /u/AmrDeveloper
[visit reddit] [comments ..read more
Reddit » The Rust Programming Language
11h ago
I am going through the Rust Book and on this chapter, it is discussing closures with the following code example:
#[derive(Debug, PartialEq, Copy, Clone)] enum ShirtColor { Red, Blue, } struct Inventory { shirts: Vec<ShirtColor>, } impl Inventory { fn giveaway(&self, user_preference: Option<ShirtColor>) -> ShirtColor { // Book uses this example //user_preference.unwrap_or_else(|| self.most_stocked()) // This presents same result match user_preference { Some(x) => return x, None => return self.most_stocked(), } } fn most_stocked(&self) -> ShirtColor { let mut nu ..read more