Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Different Types of Memory in Rust¶
Rust has 3 different types of memory: static memory, stack memory and heap memory.
Static variables live in static memory and is determined at compile time. It is suggested that you define large data variables as static so that they live in the static memory instead of stack memory to avoid stack overflow problems. Of course, another way is to put those variables into heap memory (but at the cost of slight performance loss).
Implement a Singleton in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
std::cell::OnceCell is a partial implementation of
once_cell
in the Rust standard library.There are 2 Rust crates lazy_static and once_cell for (lazy) once assignment (which can be used to create singletons). once_cell
Define Variables in Rust
Filter a Polars DataFrame in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
LazyFrame.filter
filters rows using anExpr
whileDataFrame.filter
filters rows using a mask of the typeChunkedArray<BooleanType>
.
Filter a Polars LazyFrame in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
LazyFrame.filter
filters rows using anExpr
whileDataFrame.filter
filters rows using a mask of the typeChunkedArray<BooleanType>
.