Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
tokio
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
-
tail
My implementation of the tail tool to (continuously) read the tail end of a file. See https://en.wikipedia.org/wiki/Tail_(Unix) (by LeCyberDucky)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
I have a struct which has one field generic over some type T (that I don't know), and its leaked from a Box. An easy way to free it is using Box::from_raw, but this will run the destructor for the T, which I don't want. My first thought was transmuting Struct to Struct>, but after reading this issue, it seems its not sound because of some trait trickery. Would this be solved by transmuting from Struct to Struct> where MyManuallyDrop is a private #[repr(transparent)] struct over ManuallyDrop?
you can see the RFC for this feature here: https://github.com/rust-lang/rfcs/blob/master/text/0213-defaulted-type-params.md
Well nom does list out examples on the readme page, though many are probably for older versions of nom. I clicked through a couple and it looks like ntp is up to date with nom 6.0. The last full parser I wrote using nom was in v4.0 days, which was more macro-oriented than current nom. Since what you pass nom is slices of data, you will basically be reading from a file into a buffer, and calling your parsing functions on that. If it returns an error indicating it is incomplete, just read in another chunk of data into your buffer and try again.
According to the maintainers you could use a concrete connection type's connect (e.g. RustConnection::connect). The freestanding connect functions is only there to picks an appropriate type depending on enabled features. Take a look at this discussion: https://github.com/psychon/x11rb/issues/185
Repo, Minimal reproduction
Per "Too Many Linked Lists" exercises, I share my understanding of the "boxed_node drop-ing" immediately below. Is it correct?
The Rust FFI Omnibus didn't have any examples of this nor have I found anything on SO yet: what's the right way to FFI pass a C# byte[] back and forth as a Rust Vec?
While this is being actively worked on, you can use many techniques to speed up debug compile times. The most common strategy is to use a different linker—usually lld on linux or zld on macos—for debug builds. Some good "fast compile" references include Bevy's fast compilation configuration and Matthais's blog post about compile times. A search for "rust fast compile" yields more resources and investigations into rust's compile times. There's also the the arewefastyet.rs which benchmarks the Rust compiler and has a FAQ section that answers many questions about compile times.
It may be useful to use separate lifetimes when you don't want to be limited by the shorter one. For an unfortunate example where this makes a difference see rust-lang/rust#73788
The context is not available when you are using the async/await syntax because the context could change from one await to another. The easiest way to get access to it is using poll_fn, but please be aware that this is often not the best way to proceed. In case you are looking for an try_recv replacement, you should instead follow the suggestions in tokio/3350.
So you're basically asking if you can have it look for path dependencies without putting a path = "..." in your Cargo.toml? The answer is no, and I'm not convinced it would be a good idea, since it would break if someone uploaded a dependency of the same name to crates.io.
B. erased-serde
It looks like the feature I'm looking for is waiting to be implemented here: https://github.com/serde-rs/serde/issues/1402
I'm working on a side-quest, and I just started using unit tests (hurray!): https://github.com/LeCyberDucky/tail/blob/main/src/main.rs