惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
Cloudbric
Cloudbric
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
博客园_首页
The Cloudflare Blog
C
Cisco Blogs
AWS News Blog
AWS News Blog
IT之家
IT之家
Cyberwarzone
Cyberwarzone
罗磊的独立博客
美团技术团队
V
V2EX
Project Zero
Project Zero
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
S
Schneier on Security
P
Privacy International News Feed
V
Visual Studio Blog
量子位
T
Tor Project blog
S
Securelist
腾讯CDC
A
About on SuperTechFans
T
Threat Research - Cisco Blogs
G
GRAHAM CLULEY
B
Blog RSS Feed
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
B
Blog
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
V
Vulnerabilities – Threatpost
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LINUX DO - 热门话题
Recorded Future
Recorded Future

The Rust Programming Language Forum - Latest topics

Beginner building a Rust backend framework (AI-assisted) — feedback appreciated C++ to Rust -- Exceptions Re-exporting a trait with a custom derive_macro Gold linker is deprecated Why is using PhantomData valid in this case? Code review for Static Pool Allocator Looking for a pool based allocator Why is this legal? What does it mean for Rustc to run "out of TLS keys"? Using async/await internally with no internal runtime, but exposing a nonblocking poll API — is this a reasonable design? Testing functions that use randomness `cargo-path`: improve coding agents&#39; ability to find Rust documentation Rust task runners Lifetime weird case Windows - USB device not detected A random rustc-ice-[...].txt file appeared Develop rust where the environment is setup in a docker Undefined Behavior: in-bounds pointer arithmetic failed: attempting to offset pointer by 20 bytes, but got alloc238 which is only 1 byte from the end of the allocation Unbug 0.5 - Runtime debug assertions Is there a tiny error in section 6.2 Reference types? Lifetime woes implementing ratatui::Widget for a reference Rusqlite + Chrono: How do I simplify code to obtain chrono datetime value From OOP to Rust – struggling with code organization and data structure design Way to avoid a self-referential struct Rust RF and audio resources/communities Whyhttp - HTTP mocks that fail where the bug actually is Using tokio channel permits in a tower service Arc::increment_strong_count design question (cross-post) `&T`, `&mut T`, `Pin<&mut T>` and `&Cell<T>`: Ways of Borrowing a `T` Ratatui detect arrow key press and release Feedback about post in medium Debugger not showing/offering variables? nestrs: a NestJS-style framework for Rust built on Axum and Tower Confusion about struct variance with &mut dyn Narwhal v0.6.0 – message broker for edge apps, now with channel persistence Quiche client sent message not received at the server side "mysql" "Packets out of sync" - workaround Consistency f64 and std::Simd<f64, N> Signal semantics for Rust Snowflake-gen 1.0 - Configurable Snowflake ID generator with thread-local global API How do I do hmr in rust Diving into Rust: My Journey So Far and a Few Hiccups Celerity 0.1.1: pure Rust ZMTP 3.1 with a sans-IO core, Tokio transport, and CURVE-RS How to call struct method as function pointer in loop Loops inside loops and mutable reference on Iterator VSCode - rust-analyzer - annoying re-builds due to RUSTC_BOOTSTRAP changed Borsh v1.6.1 example What's everyone working on this week (17/2026)? Cargo test's verbose output - can I quiet it? Sem: semantic entity level version control CLI built with tree-sitter How do i get all the words in a string and convert it into a vector? Looking for feedback on my first tokenizer in Rust Frostmirror - (lightweight airgap alternative inspired from panamax and romt) - an offline cargo repository for airgap system that can be deployed through a docker image Does "ill-formed, no diagnostic required" exist in Rust? If a program is built with software floating-point emulation, is it affected by hardware floating-point environment? Rustc-link-lib static library How does crates.io and docs.rs store crates? Various input in one line error[E0080]: index out of bounds error when trying to install LuaCAD CSV to SQLite - Is it better to write records as they are being read Looking for feedback for a graph-based task scheduler Confusion: struct directly followed by impl? This is my first project. I invented a new algorithm that even AI don't know. It's about bigint. And I'm 15. Thanks for watching. By the way, my crate named `nna` Why Windows rustc uses a different color scheme? Associate a struct with every enum variant Which Windows env var is responsible for DNS resolition? Clap completion question Is RMW operation less prone to reading stale values than a pure load? Why are builds of my crate's test not consistent (cargo build vs cargo test vs VSCode-Test-Explorer) Why there is no downcast method Type inference of generic parameters How to make Rust as vertical as possible? Cyw43 on STM32H723 Typing is fun! Another crate for self-referential structs How to use build-analysis feature? Why can't I upgrade a known-exclusive &T to &mut T? Issues with Boxed trait objects Rust-analyzer Language Server Loops with accumulated state confuse me LoMux: Adobe Media Encoder Alternative (First Rust Project) Cbor-core: A deterministic CBOR::Core encoder/decoder Numa - a DNS resolver from scratch How should I deal with copying and renaming in monitoring of files? Request get to api.github.com Compiler Preprocessing Optimization Lifetime trait bounds issue High-Performance API Gateway Implemented a Rust-based CLI tool that supports Ollama's local LLMs Egui_tracing 0.3 — a live tracing/log viewer widget for egui apps Elevation-kit capstone project Panic-free-friendly standard library Work around library with private trait in public trait bound My custom Tab implementation with Slint How to express this complex struct definition which uses closures and multiple layers of higher-ranked lifetimes in Rust? 30K lines of no_std Rust: a bare-metal ARM64 hypervisor that replaces Google's Hafnium SPMC Imperartive or functional? Any improvements? Loop unrolling in manually written loops vs iterators (AVX512) Announcing cachekit 0.7 — pluggable cache policies and arena-backed primitives Need some suggestions Having Multiple Mutable References via Iterators
Crates with excluded proprietary parts
blonk · 2026-04-17 · via The Rust Programming Language Forum - Latest topics

April 17, 2026, 9:45am 1

I was asked if I want to port an old C library to Rust, and while niche it seems like a pretty cool library to have (in case anyone is dabbling with mixmaster/mixminion type networks in Rust). However, the C version has a feature (involving forward error correction) that the client is a little unsure about with regards to ownership and patents. (Because of how old this library is, it makes me suspect there are no patent issues, but that's beside the point).

I asked if I could make the library open source, and they are fine with it as long as the fec support is left out.

Let's say I would ideally like to not have two different repos/projects for this, what mechanisms does rust/cargo have to help allow more code in the repo than in the published crate?

My spitball idea is to have build.rs check for the existence of src/fec.rs and set a cfg parameter if it finds it, and add the src/fec.rs to the exclude list in Cargo.toml.

Anyone know if there are any crates that do anything like this that one can take inspiration from?

I may end up setting up two different repositories, just to lessen the risk of accidental publishing of the fec parts. But I'm curious to know how this could be accomplished with a single repo and how safe from accidental-publishing-of-the-proprietary-parts one can make it.

ZiCog April 17, 2026, 9:56am 2

How big and complex is that forward error correction? Is there a specification for it? Potentially you could delete the old C implementation (thus leaving it out as required) and create a new implementation in Rust from scratch. Assuming any patents on it have expired you would be in the clear.

giocri April 17, 2026, 9:57am 3

i'd advise you to not keep code with different licenses in the same repo, best solution is to just have 2 repos and use a git dependency

abj April 17, 2026, 11:15am 4

I think two repos is the way to go, otherwise it is a high risk of accidental publishing. There are just too many cases of this already and once code is out, it is out, no way back.

Feature gate the proprietary part, use your own non-public package repo and all should be fine as long as code compiles/works with or without given feature. But for library to be more useful it would be nice that proprietary part can be replaced by non-proprietary, so when designing that should be taken into account (maybe use generics or what not), otherwise the library might not be as useful as it could be.

akrauze April 17, 2026, 12:33pm 5

You left out pretty important topic. How do you want to distribute this library and its proprietary part? How was C library distributed? Will you write a rust implementation and compile it to a shared library with C ABI? Should it be used by normal Rust projects with Cargo integration?

kornel April 18, 2026, 1:32am 6

You can use include in Cargo.toml to select only files/dirs you want to publish.

cargo package --list to verify that it selects what you want.

You can use .cargo/config.toml to have local settings that don't get published, and there you can set a custom env var or cfg or [patch.crates-io] to disable or substitute some code.

You can also just use a regular Cargo flag that puts unpublished module behind the flag. The published crate will work without the file as long as the Cargo feature isn't enabled. If a mod is disabled, Rust wont look for it. rustfmt might complain, but a) #[rustfmt::skip] solves that too, b) nobody needs to run rustfmt on a published crate.