Skip to content

Add Rust starter template#349

Merged
ChiragAgg5k merged 2 commits into
mainfrom
add-rust-starter-template
May 2, 2026
Merged

Add Rust starter template#349
ChiragAgg5k merged 2 commits into
mainfrom
add-rust-starter-template

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

What

Adds a Rust starter template for Appwrite Functions.

The starter mirrors the existing SDK-based starter pattern used by Node and other runtimes:

  • initializes the Appwrite Rust SDK client
  • uses the dynamic function key from x-appwrite-key
  • calls Users.list() and logs the total user count
  • returns Pong for /ping
  • returns the standard starter JSON response for other routes

Also adds rust: "Rust" to the README table generator runtime labels. The root README table itself is intentionally left unchanged to avoid broad generated table churn; the existing workflow can regenerate it after merge.

Testing

  • cargo generate-lockfile
  • cargo fmt --check
  • cargo check
  • docker run -e OPEN_RUNTIMES_ENTRYPOINT=main.rs --rm --volume "$PWD:/mnt/code" openruntimes/rust:v5-1.83 bash helpers/build.sh

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 2, 2026

Greptile Summary

Adds a Rust starter template that mirrors the existing Node/SDK-based pattern: initialises the Appwrite Rust SDK client, calls Users.list(), logs the total, and returns /ping or the standard JSON response. The implementation is clean and the new_current_thread runtime choice is appropriate.

Confidence Score: 5/5

Safe to merge; the only finding is a P2 suggestion to make tokio feature declarations more explicit.

No P0 or P1 issues found. The single P2 concern (implicit tokio feature reliance) does not affect correctness for the current dependency tree. P2s do not lower the confidence score.

rust/starter/Cargo.toml — tokio feature list could be more explicit.

Important Files Changed

Filename Overview
.github/workflows/markdown-table-workflow/index.js Adds rust: "Rust" entry to the verboseRuntimes map so the table generator recognises Rust templates.
rust/starter/Cargo.toml Declares crate as a lib targeting main.rs; tokio feature list is narrower than what enable_all() actually requires at runtime.
rust/starter/main.rs Starter handler: mirrors Node pattern (SDK client, Users.list, /ping route, JSON response). Uses current-thread Tokio runtime per invocation, which is acceptable for a template.
rust/starter/README.md Matches the standard starter README structure; 'No environment variables required' is consistent with other SDK-using starters where APPWRITE_FUNCTION_* vars are platform-injected.
rust/starter/.gitignore Standard Rust gitignore (target/) plus Appwrite CLI directory (.appwrite).
rust/starter/Cargo.lock Generated lockfile committed as expected for an application/function crate.

Reviews (2): Last reviewed commit: "fix: use current-thread runtime in Rust ..." | Re-trigger Greptile

Comment thread rust/starter/main.rs Outdated
@ChiragAgg5k ChiragAgg5k merged commit 7717e63 into main May 2, 2026
1 check passed
@ChiragAgg5k ChiragAgg5k deleted the add-rust-starter-template branch May 2, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants