Rust
Information
Section titled “Information”Rust is a modern systems programming language that aims to provide memory safety, concurrency, and high performance without sacrificing control over system resources. Developed by Mozilla and now maintained by the Rust Foundation, it is designed to address common issues found in other languages like C and C++, such as null pointer dereferencing and buffer overflows, through its powerful ownership model and strict compile-time checks. Rust’s expressive type system, robust package manager (Cargo), and thriving ecosystem make it a popular choice for building reliable and efficient software, from operating systems and game engines to web servers and command-line tools.
Install
Section titled “Install”Installing Rust on Linux, MacOS, or WSL involves using the rustup tool, which manages the Rust installation and its associated tools.
You can install rustup by running a simple curl command in the terminal and following the prompts to complete the setup.
After configuring your shell and verifying the installation, you’ll have a fully functional Rust development environment ready for use.
-
Install Rust using
rustup:Open a terminal and run the following command to download and install the
rustuptool, which will manage your Rust installation.Terminal window curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | shFollow the prompts during the installation process to proceed with the default installation options. If the installation is successful, you will see a message indicating that Rust has been installed.
-
Configure Your Shell:
After the installation is complete, you need to configure your current shell session to use Rust by running the following command:
Terminal window source $HOME/.cargo/envThis command ensures that Rust and its associated tools are available in your shell environment.
-
Verify the Installation:
To confirm that Rust has been installed correctly, check the version of the Rust compiler with the following command:
Terminal window rustc --versionThis command should display the installed version of Rust, indicating that the installation was successful.
-
Install Required Dependencies:
Rust requires a linker to combine its compiled outputs into one file. You may need to install additional tools if you encounter linker errors.
On Ubuntu/Debian:
Terminal window sudo apt updatesudo apt install build-essentialOn Fedora:
Terminal window sudo dnf groupinstall 'Development Tools'On Arch Linux:
Terminal window sudo pacman -S base-develOn MacOS:
Install Xcode command line tools, which include a C compiler and linker.
Terminal window xcode-select --install -
Update Rust:
Keep your Rust installation up-to-date with the following command:
Terminal window rustup update -
Configure Your Development Environment:
To make the most of Rust, you should set up a development environment.
Install Visual Studio Code (optional):
VS Code is a popular code editor with excellent support for Rust.
On Linux:
Terminal window sudo snap install --classic codeOn MacOS:
Download and install from the official website.
Install the Rust extension for VS Code:
Open VS Code and install the “rust-analyzer” extension for Rust language support.
Set up your first Rust project:
Terminal window cargo new hello_worldcd hello_worldcargo runThis will create a new Rust project named
hello_world, navigate into the project directory, and run the sample application. -
Explore Rust Documentation:
Rust has extensive documentation and a friendly community. Here are some resources to get you started:
Update
Section titled “Update”Updating Rust is simple and straightforward using the rustup tool.
By running the rustup update command in your terminal, you can ensure that your Rust installation and all associated components are kept up-to-date with the latest stable versions.
-
Open a Terminal:
Ensure that you have access to a terminal on your Linux, MacOS, or WSL system.
-
Run the
rustupUpdate Command:Use the following command to update Rust and all installed components to the latest version:
Terminal window rustup updateThis command will download and install the latest stable version of Rust and update all installed toolchains.
-
Verify the Update:
After the update process is complete, verify that Rust has been updated successfully by checking the version:
Terminal window rustc --versionThis command should display the latest version of Rust, confirming that the update was successful.
-
Clean Up Old Versions (optional):
To free up disk space, you can remove older versions of Rust that are no longer needed by running:
Terminal window rustup self uninstallThis command will prompt you to confirm the removal of old toolchains and components.
Cargo is the Rust package manager and build system, designed to streamline the process of managing dependencies, compiling code, and building projects. It simplifies tasks like creating new projects, running tests, and generating documentation with easy-to-use commands. Cargo ensures that Rust developers can efficiently manage their projects’ libraries and tools, maintaining consistency and reliability throughout the development lifecycle.
-
Install Rust and Cargo:
Cargo comes bundled with Rust, so installing Rust also installs Cargo. If you haven’t installed Rust yet, follow the installation steps below:
Open a terminal and run the following command:
Terminal window curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | shFollow the prompts to complete the installation. Once Rust is installed, Cargo will be installed automatically.
-
Verify Cargo Installation:
To ensure Cargo is installed correctly, check its version by running:
Terminal window cargo --versionThis command should display the installed version of Cargo, confirming the installation was successful.
-
Create a New Rust Project:
Use Cargo to create a new Rust project by running:
Terminal window cargo new my_projectcd my_projectThis command creates a new directory named
my_projectwith the necessary files and structure for a Rust project. -
Build the Project:
To compile your Rust project, navigate to your project directory and run:
Terminal window cargo buildThis command compiles your project and produces an executable in the
target/debugdirectory. -
Run the Project:
After building your project, you can run it with:
Terminal window cargo runThis command compiles (if necessary) and runs your project, displaying any output in the terminal.
-
Add Dependencies:
To add external libraries (dependencies) to your project, edit the
Cargo.tomlfile in your project directory and add the desired dependencies under the[dependencies]section. For example:[dependencies]serde = "1.0"After adding dependencies, run:
Terminal window cargo buildCargo will download and compile the specified dependencies for your project.
-
Run Tests:
To run tests defined in your project, use:
Terminal window cargo testThis command compiles and runs any tests found in the
testsdirectory or within your source files. -
Generate Documentation:
Cargo can generate documentation for your project and its dependencies. To generate and view the documentation, run:
Terminal window cargo doc --openThis command generates HTML documentation and opens it in your default web browser.
-
(Optional) Install Cargo Watch:
Cargo Watch automatically runs Cargo commands when file changes are detected, useful for continuous development.
Install Cargo Watch:
Terminal window cargo install cargo-watchUse Cargo Watch:
To automatically recompile your project when you make changes, run:
Terminal window cargo watch -x buildFor automatic testing on file changes, use:
Terminal window cargo watch -x test
Guides
Section titled “Guides”-
The Rust Programming Language Book
(From the Official Rust Lang Website) This book assumes that you’ve written code in another programming language but doesn’t make any assumptions about which one. We’ve tried to make the material broadly accessible to those from a wide variety of programming backgrounds. We don’t spend a lot of time talking about what programming is or how to think about it. If you’re entirely new to programming, you would be better served by reading a book that specifically provides an introduction to programming.
-
The aim of this tutorial is to take you to a place where you can read and write enough Rust to fully appreciate the excellent learning resources available online, in particular The Book. It’s an opportunity to try before you buy, and get enough feeling for the power of the language to want to go deeper.
-
This small book describes how to use Rust and WebAssembly together.
-
This Rust Cookbook is a collection of simple examples that demonstrate good practices to accomplish common programming tasks, using the crates of the Rust ecosystem.
Examples
Section titled “Examples”- These are some examples of repos, demos, and source code written in rust!
MicroService
Section titled “MicroService”This is a quick repo / guide on a Rust MySQL Microservice! Official Repo
Youki is an Open Container Initiative runtime specification library written in Rust.
Official Youki Repo
There are some issues with some devices within CGroups v2 that should be noted.
Since youki is a low-level runtime, its recommend that you combine it with a high-level runtime, such as Docker / Podman.
- Axum is an ergonomic and modular Rust web application framework.
- Github Repo
- Axum can be extended through Tower, which is an ecosystem of middleware, services and utilities
This crate is a user-friendly, easy-to-integrate, immediate-mode GUI library designed for rapid development of interactive applications in Rust.
egui Dependency
Section titled “egui Dependency”-
There are some dependencies that you might require when working with
egui:Terminal window sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev- Note: These dependencies are for Ubuntu / WSL.
-
Making sure the
rustuphas thewasmcomponents.Terminal window rustup target add wasm32-unknown-unknow -
Installing
TrunkTerminal window cargo install --locked trunk
Bevy is a data-driven game engine built in Rust, using an Entity Component System (ECS) architecture.
The KBVE isometric game (apps/kbve/isometric) runs on Bevy 0.18 with WGPU as its rendering backend, targeting both native desktop (via Tauri) and WebAssembly (WebGPU).
WGPU Rendering Pipeline
Section titled “WGPU Rendering Pipeline”The isometric game initializes WGPU directly for desktop builds, bypassing Bevy’s default windowing to render inside a Tauri webview surface.
Device Configuration
Section titled “Device Configuration”// renderer.rs — WGPU initializationlet instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: wgpu::Backends::all(), // Vulkan, Metal, DX12, GL ..Default::default()});
let adapter = instance.request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::HighPerformance, compatible_surface: Some(&surface), force_fallback_adapter: false,}).await;
let (device, queue) = adapter.request_device(&wgpu::DeviceDescriptor { required_features: wgpu::Features::empty(), required_limits: wgpu::Limits::default(), ..Default::default()}).await;| Setting | Value | Notes |
|---|---|---|
| Backends | all() | Auto-selects Vulkan/Metal/DX12 per platform |
| Power preference | HighPerformance | Ensures discrete GPU on switchable laptops |
| Features | empty() | No optional WGPU features requested |
| Limits | default() | Standard limits (2048 textures, 8 bind groups) |
Render Architecture
Section titled “Render Architecture”graph TD
A[Tauri WebviewWindow] -->|raw_window_handle| B[wgpu::Surface]
B --> C[wgpu::Adapter]
C --> D[wgpu::Device + Queue]
D -->|RenderCreation::Manual| E[Bevy RenderPlugin]
E --> F[Forward Renderer]
F --> G[PBR Pipeline]
F --> H[Sprite Pipeline]
F --> I[Custom Materials]
I --> I1[WaterMaterial]
I --> I2[PixelateMaterial]
I --> I3[OrbMaterial]
I --> I4[SmokeMaterial]
On WASM, Bevy’s default WebGPU backend is used instead of the manual surface creation.
Mesh and Texture Pipeline
Section titled “Mesh and Texture Pipeline”The game uses two fundamentally different mesh strategies: static chunk meshes built once at load time, and animated sprite meshes updated per frame via UV shifting.
Static Chunk Meshes (Tilemap)
Section titled “Static Chunk Meshes (Tilemap)”Terrain is divided into 16x16 tile chunks. Each chunk produces up to 4 meshes (body, cap, grass, water), built once and never updated:
// tilemap.rs — chunk mesh built via builder pattern (immutable after creation)Mesh::new(PrimitiveTopology::TriangleList, RenderAssetUsages::default()) .with_inserted_attribute(Mesh::ATTRIBUTE_POSITION, positions) .with_inserted_attribute(Mesh::ATTRIBUTE_NORMAL, normals) .with_inserted_attribute(Mesh::ATTRIBUTE_COLOR, colors) // vertex colors for terrain bands .with_inserted_attribute(Mesh::ATTRIBUTE_UV_0, uvs) // tileset UVs .with_inserted_indices(Indices::U32(indices))Chunk meshes use vertex colors as the primary shading mechanism (grass shades, dirt/stone/snow height bands), reducing material count. Only grass cap surfaces use UV-mapped textures from a tileset atlas.
UV-Shift Sprite Animation (Creatures)
Section titled “UV-Shift Sprite Animation (Creatures)”Sprite creatures (frogs, wraiths) use per-frame mesh UV updates to animate through sprite sheet frames:
// Per-frame UV computation from atlas grid positionfn frame_uvs(anim: &Anim, frame: u32, flip: bool) -> [[f32; 2]; 4] { let col = anim.start_col + (frame % anim.frame_count); let row = anim.row; let u0 = col as f32 * FRAME_W; let u1 = u0 + FRAME_W; let v0 = row as f32 * FRAME_H; let v1 = v0 + FRAME_H; if flip { [[u1, v0], [u0, v0], [u0, v1], [u1, v1]] // horizontal flip } else { [[u0, v0], [u1, v0], [u1, v1], [u0, v1]] }}
// Applied every frame — triggers GPU buffer re-uploadmesh.insert_attribute(Mesh::ATTRIBUTE_UV_0, vec![uvs[0], uvs[1], uvs[2], uvs[3]]);Each insert_attribute call replaces the mesh’s UV buffer and triggers a GPU upload via Bevy’s render asset system.
Per-Frame GPU Upload Budget
Section titled “Per-Frame GPU Upload Budget”graph LR
subgraph "Per-Frame Mesh Uploads (Worst Case)"
F[Frogs x8] -->|8 UV uploads| GPU
W[Wraiths x6] -->|6 UV uploads| GPU
end
subgraph "Zero Per-Frame Uploads"
FF[Fireflies x80] -.->|transform only| GPU
BF[Butterflies x14] -.->|transform only| GPU
TM[Tilemap chunks] -.->|built once| GPU
end
| System | Entities | Per-Frame Uploads | Upload Type |
|---|---|---|---|
| Frogs | 8 pool | 8 | ATTRIBUTE_UV_0 (4 vec2s) |
| Wraiths | 6 pool | 6 | ATTRIBUTE_UV_0 (4 vec2s) |
| Fireflies | 80 pool | 0 | Transform + emissive only |
| Butterflies | 14 pool | 0 | Transform + vertex morph |
| Tilemap | ~50 chunks | 0 | Built once at chunk load |
| Total | 14 |
At 14 uploads of 32 bytes each (4 vertices x 2 floats x 4 bytes), the total per-frame mesh data is 448 bytes — negligible on any GPU. The overhead is not the data size but the draw call overhead of Bevy’s render asset change detection and GPU buffer staging.
Custom Shader Materials
Section titled “Custom Shader Materials”All custom shaders use Bevy’s Material trait with AsBindGroup for automatic uniform binding:
// water.rs — custom material with uniform block#[derive(Asset, TypePath, AsBindGroup, Clone)]pub struct WaterMaterial { #[uniform(0)] pub uniforms: WaterUniforms,}
#[derive(ShaderType, Clone, Copy)]pub struct WaterUniforms { pub base_color: Vec4, // surface color pub deep_color: Vec4, // depth color pub ripple_speed: f32, // wave animation speed pub ripple_scale: f32, // wave pattern density pub highlight_strength: f32, // specular intensity pub foam_intensity: f32, // edge foam}Bevy’s MaterialPlugin<T> handles bind group creation, buffer allocation, and shader pipeline setup. Time is accessed in shaders via Bevy’s built-in globals.time uniform.
| Shader | File | Purpose | Technique |
|---|---|---|---|
water.wgsl | Animated water surfaces | Procedural noise + pixelated UV + foam | Value noise, overlay blend |
pixelate.wgsl | Post-processing | Toon/cel-shading + edge detection | Screen-space quantization |
orb.wgsl | HUD health/mana orbs | Fake spherical lighting + liquid sim | Meniscus + wobble |
smoke.wgsl | Particle effects | Multi-lobe silhouette + FBM noise | Stepped pixel drift |
Optimization Opportunities
Section titled “Optimization Opportunities”Uniform-driven UV offset (eliminates per-frame mesh uploads):
Instead of rewriting the mesh UV buffer each frame, pass the current frame column and row as a shader uniform and compute UVs in the vertex shader:
struct SpriteUniforms { frame_col: f32, frame_row: f32, sheet_cols: f32, sheet_rows: f32, flip: f32,};
@group(3) @binding(0) var<uniform> sprite: SpriteUniforms;
@vertexfn vertex(in: VertexInput) -> VertexOutput { var out: VertexOutput; let frame_w = 1.0 / sprite.sheet_cols; let frame_h = 1.0 / sprite.sheet_rows; var u = in.uv.x * frame_w + sprite.frame_col * frame_w; let v = in.uv.y * frame_h + sprite.frame_row * frame_h; if (sprite.flip > 0.5) { u = (sprite.frame_col + 1.0) * frame_w - (u - sprite.frame_col * frame_w); } out.uv = vec2(u, v); out.position = mesh_position_local_to_clip(in.position); return out;}This approach:
- Eliminates all
insert_attributecalls (zero mesh uploads per frame) - Moves UV computation to the GPU (where it belongs)
- Enables instanced rendering — all creatures of the same type can share one mesh
- Reduces CPU-GPU sync points from 14/frame to 0/frame
graph LR
subgraph "Current: CPU UV Rewrite"
CPU1[Compute UVs] --> BUF1[Write to mesh buffer] --> UP1[GPU upload]
end
subgraph "Proposed: Uniform UV Offset"
CPU2[Set frame_col uniform] --> UNI[Uniform buffer update]
end
style UP1 fill:#f66,stroke:#333
style UNI fill:#6f6,stroke:#333
Texture compression:
Sprite atlases are stored as uncompressed RGBA8 PNG. GPU-compressed formats reduce VRAM usage by ~4x:
| Format | Platform | Compression | Atlas VRAM |
|---|---|---|---|
| RGBA8 (current) | All | None | ~4.8 MB |
| BC7 | Desktop (Vulkan/DX12/Metal) | 4:1 | ~1.2 MB |
| ASTC 4x4 | Mobile/WebGPU | 4:1 | ~1.2 MB |
Bevy supports .ktx2 with basis universal transcoding for cross-platform compressed textures.
Instanced rendering:
All sprite creatures of the same type share identical geometry (a quad). With the uniform-driven UV approach, these could use GPU instancing — one draw call for all frogs, one for all wraiths — reducing draw calls from 14 to 2.
Q is a powerful Godot Helper Crate designed for Rust developers using the GDExtension API. It provides a robust set of tools to streamline game development, including a versatile Game Manager for handling core game logic, a Music Manager for seamless audio integration, and a Bevy ECS implementation for efficient entity-component-system architecture. Additionally, Q leverages Tokio for high-performance multi-threading, enabling smooth and scalable concurrency in your Godot projects. Whether you’re building complex systems or optimizing performance, Q is your go-to crate for enhancing Rust-based Godot development.
To build the crate on the mac, we have three options, the first is through the Nx monorepo command: ./kbve.sh -nx q:build-mac!
The other option would be to run a docker image to do the build process and the final option would be a git workflow, more on those two later on.
Askama
Section titled “Askama”Askama is a compile-time type-safe templating engine for Rust, inspired by Jinja2. It compiles templates into Rust code at build time, catching errors before runtime and producing zero-allocation rendering. In the KBVE monorepo, we use Askama with Axum to serve dynamic pages where Astro generates the HTML shell and Askama fills in the data.
Askama with Astro — The Template Pipeline
Section titled “Askama with Astro — The Template Pipeline”The core pattern: Astro builds the template, Axum fills in the variables at runtime.
This gives us the best of both worlds:
- Astro’s full static site shell (nav, CSS bundles, layout, Starlight integration)
- Axum’s dynamic data injection (meme content, user profiles, OG meta tags)
How It Works
Section titled “How It Works”1. Astro build → outputs HTML with {{ askama_vars }} as literal text2. Copy step → moves Astro's output into Rust's templates/ directory3. Cargo build → askama compiles those HTML files into Rust code4. Runtime → Axum resolves data, askama substitutes {{ vars }}, serves HTMLThe key insight is that Astro treats {{ variable }} as plain text — it does not interpret double curly braces.
When Astro builds, the output HTML literally contains {{ meme_id }}, {{ title }}, etc.
Askama then picks up that HTML file as a template and compiles it into type-checked Rust code.
Build Order (Critical)
Section titled “Build Order (Critical)”Askama templates are compiled at Rust build time, not runtime.
This means the Astro build output must exist before cargo build runs.
Local development:
# 1. Build Astro firstnpx nx run astro-memes:build
# 2. Copy the askama page output into Rust's template directorycp dist/apps/astro-memes/askama/meme/index.html \ apps/memes/axum-memes/templates/askama/meme.html
# 3. Build Rust (askama compiles the template)cargo build --manifest-path apps/memes/axum-memes/Cargo.tomlDockerfile (multi-stage):
# Stage 1: Build AstroFROM node:22-alpine AS astro-buildWORKDIR /appCOPY . .RUN pnpm install && npx nx run astro-memes:build
# Stage 2: Build Rust (askama needs Astro output)FROM rust:1.87 AS rust-buildWORKDIR /appCOPY . .COPY --from=astro-build /app/dist/apps/astro-memes /app/apps/memes/axum-memes/templates/distRUN cargo build --release --manifest-path apps/memes/axum-memes/Cargo.toml
# Stage 3: RuntimeFROM debian:bookworm-slimCOPY --from=rust-build /app/target/release/axum-memes /usr/local/bin/COPY --from=astro-build /app/dist/apps/astro-memes /app/templates/distCMD ["axum-memes"]The Rust build stage receives the Astro output via COPY --from=astro-build, ensuring askama can find and compile the templates.
Creating an Askama-Powered Astro Page
Section titled “Creating an Askama-Powered Astro Page”-
Create the Astro MDX page with askama variables in the frontmatter.
Place it under
src/content/docs/askama/so it builds to a known path. Use askama template syntax ({{ var }},{% if %},{% for %}) directly in the frontmatter and component props — Astro outputs them as literal text.---title: "{{ title }} | Meme.sh"head:- tag: metaattrs:property: "og:title"content: "{{ title }}"- tag: metaattrs:property: "og:image"content: "{{ og_image }}"- tag: metaattrs:property: "og:url"content: "{{ canonical_url }}"description: "{{ description }}"template: splashsidebar:hidden: true---import AskamaMyProvider from '@/components/providers/AskamaMyProvider.astro';<AskamaMyProvider /> -
Create the Astro provider component that renders the page body with askama variables.
The provider defines askama template variables as JavaScript string literals. These are injected into the HTML via
set:html— Astro outputs them verbatim.AskamaMyProvider.astro ---// Askama variables: {{ title }}, {{ body_content }}, {{ author }}const askamaTitle = `{{ title }}`;const authorBlock = `{% if !author.is_empty() %}<p class="author">by {{ author }}</p>{% endif %}`;---<article data-id={`{{ item_id }}`}><h1 set:html={askamaTitle} /><Fragment set:html={authorBlock} /><!-- React island hydration target --><div id="interactive-island" data-id={`{{ item_id }}`}></div></article><style>.author { color: #a1a1aa; font-size: 0.875rem; }</style>Key patterns:
- Use backtick strings for askama variables:
const x = `{{ var }}`; - Use
set:htmlto inject askama blocks containing conditionals/loops - Use
<Fragment set:html={block} />for multi-line askama blocks - Include a
<div id="...">for React island hydration if needed
- Use backtick strings for askama variables:
-
Define the Rust askama struct that maps to the template variables.
The struct fields must match the
{{ var }}names in the template exactly.use askama::Template;#[derive(Template)]#[template(path = "askama/my_page.html")]pub struct MyPageTemplate {pub item_id: String,pub title: String,pub description: String,pub canonical_url: String,pub og_image: String,pub author: String,pub body_content: String,}The
pathis relative to thetemplates/directory configured inCargo.toml:[package.metadata.askama]dirs = ["templates"] -
Create the Axum route handler that fetches data and renders the template.
async fn page_handler(State(state): State<AppState>,Path(id): Path<String>,) -> Response {match resolve_item(&state, &id).await {Ok(Some(item)) => {let template = MyPageTemplate {item_id: item.id.clone(),title: item.title.clone(),description: item.description(),canonical_url: item.canonical_url(),og_image: item.thumbnail_url(),author: item.author_name.unwrap_or_default(),body_content: item.rendered_html(),};TemplateResponse(template).into_response()}Ok(None) => StatusCode::NOT_FOUND.into_response(),Err(e) => {warn!(error = %e, "failed to render page");StatusCode::INTERNAL_SERVER_ERROR.into_response()}}} -
Wire the build pipeline — ensure Astro builds before Rust.
In the Nx project config, add a dependency:
{"targets": {"build": {"dependsOn": ["astro-memes:build"],"executor": "nx:run-commands","options": {"command": "cargo build --release"}}}}Or in the Dockerfile, use multi-stage builds (see above).
Askama Template Syntax Reference
Section titled “Askama Template Syntax Reference”Askama uses Jinja2-style syntax. Here are the most common patterns used in Astro-generated templates:
Variable substitution:
<h1>{{ title }}</h1><meta property="og:image" content="{{ og_image }}" />Conditionals:
{% if !author.is_empty() %}<p>by {{ author }}</p>{% endif %}
{% if format_label == "video" %}<video src="{{ asset_url }}" controls></video>{% else %}<img src="{{ asset_url }}" alt="{{ title }}" />{% endif %}Option types (Rust Option<T>):
{% if let Some(avatar) = avatar_url %}<img src="{{ avatar }}" alt="avatar" />{% else %}<div class="placeholder">No avatar</div>{% endif %}Loops (Rust Vec<T>):
{% for tag in tags %}<span class="tag">{{ tag }}</span>{% endfor %}Filters:
{{ title|escape }}{{ content|safe }}{{ count|fmt("{:.1}") }}Integer comparisons:
{% if width > 0 %}width="{{ width }}"{% endif %}Common Pitfalls
Section titled “Common Pitfalls”Existing Askama Pages in the Monorepo
Section titled “Existing Askama Pages in the Monorepo”| App | Route | Template | Provider |
|---|---|---|---|
| kbve | /@{username} | askama/profile.mdx | AskamaProfileProvider.astro |
| kbve | /@{username} (not found) | — | AskamaProfileNotFoundProvider.astro |
| memes | /meme/{id} | askama/meme.mdx | AskamaMemeProvider.astro |
—
For continuous integration, we recommend checking out our git section for more information.
MSVC Target
Section titled “MSVC Target”There will come a time where the rust application that you are building will require Windows SDK and ABI! When that situation comes, there are three options that are available, but not limited to.
Windows Native Build
A simple approach would be to setup the Rust cargo and application on a Windows 11 operating system and compile it from there.
Github Actions
Github Actions can provide you with a cloud windows VM that will pull the source code and cargo build the target release, with pre-installed visual studio code.
Docker
Nix-ready or custom docker image that has a multi-stage build process, including a cargo chef and layer caching, provides a fast and local way to build across multiple operating systems.